Added check to see if the variable file is empty
The `pw-token-gen.py` script will fail if used against an empty file. This change adds a None type check and returns an exit error and messaage if the loaded value is None. Closes-Bug: 1446338 Change-Id: I83cb9d1ef312f870f555c6de5f42815ba40e895e
This commit is contained in:
parent
b6476c652a
commit
03646d48f3
@ -157,6 +157,12 @@ def main():
|
||||
with open(user_vars_file, 'rb') as f:
|
||||
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
|
||||
generator = CredentialGenerator()
|
||||
for entry, value in user_vars.iteritems():
|
||||
|
Loading…
Reference in New Issue
Block a user