Merge "Added check to see if the variable file is empty"

This commit is contained in:
Jenkins 2015-04-28 09:34:56 +00:00 committed by Gerrit Code Review
commit e7a6b27fd8

View File

@ -157,6 +157,12 @@ def main():
with open(user_vars_file, 'rb') as f: with open(user_vars_file, 'rb') as f:
user_vars = yaml.safe_load(f.read()) user_vars = yaml.safe_load(f.read())
if not user_vars:
raise SystemExit(
'FAIL: The variable file provided [ %s ] is empty.'
% user_vars_file
)
changed = False changed = False
generator = CredentialGenerator() generator = CredentialGenerator()
for entry, value in user_vars.iteritems(): for entry, value in user_vars.iteritems():