Allow empty yaml vars files

Fixes #7843
This commit is contained in:
James Cammarata 2014-07-04 22:59:00 -05:00
parent 51e014d915
commit ff04b2b532
3 changed files with 7 additions and 6 deletions

View file

@ -44,8 +44,10 @@ class ActionModule(object):
if os.path.exists(source):
data = utils.parse_yaml_from_file(source, vault_password=self.runner.vault_pass)
if type(data) != dict:
if data and type(data) != dict:
raise errors.AnsibleError("%s must be stored as a dictionary/hash" % source)
elif data is None:
data = {}
result = dict(ansible_facts=data)
return ReturnData(conn=conn, comm_ok=True, result=result)
else: