Skip to content

Commit

Permalink
Do not combine group_vars with an empty file
Browse files Browse the repository at this point in the history
This addresses a specific case with multiple vars files
in a group_vars/${groupname}/ directory where one of those files
is empty, which returns None instead of an empty dict.
  • Loading branch information
srgvg committed Jul 13, 2015
1 parent c4b6d91 commit 9c8f0da
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/ansible/vars/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,8 @@ def _load_inventory_file(self, path, loader):
paths = [os.path.join(path, name) for name in names if not name.startswith('.')]
for p in paths:
_found, results = self._load_inventory_file(path=p, loader=loader)
data = self._combine_vars(data, results)
if results is not None:
data = self._combine_vars(data, results)

else:
file_name, ext = os.path.splitext(path)
Expand Down

0 comments on commit 9c8f0da

Please sign in to comment.