From 043122902780e144fab758647ef503a5b994b291 Mon Sep 17 00:00:00 2001 From: Theo Chatzimichos Date: Jan 10 2018 14:09:17 +0000 Subject: bin/test_roles.py: improve to check if salt/role/$sls exist for assigned roles --- diff --git a/bin/test_roles.py b/bin/test_roles.py index d899178..af0c149 100755 --- a/bin/test_roles.py +++ b/bin/test_roles.py @@ -16,7 +16,12 @@ for directory in ['salt', 'pillar']: if sls.endswith('.sls'): with open('%s/role/%s' % (directory, sls)) as f: if sls.split('.sls')[0] not in roles: - print ('%s/role/%s not in roles' % (directory, sls)) + print('%s/role/%s not in roles' % (directory, sls)) status = 1 +for role in roles: + if not os.path.isfile('salt/role/%s.sls' % role): + print('%s is missing the salt/role/%s.sls file' % (role, role)) + status = 1 + sys.exit(status)