diff options
author | Serge van Ginderachter <serge@vanginderachter.be> | 2015-07-14 00:14:13 +0200 |
---|---|---|
committer | Serge van Ginderachter <serge@vanginderachter.be> | 2015-07-14 00:14:13 +0200 |
commit | 9c8f0da32754cc4377f3fb58b496241a38bf8344 (patch) | |
tree | 221fffb4f14b887b26df91e0c17714717c27cebb | |
parent | c4b6d91275ac9564f2e64f768b1c893f82bcf3f7 (diff) | |
download | ansible-9c8f0da32754cc4377f3fb58b496241a38bf8344.tar.gz |
Do not combine group_vars with an empty file
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.
-rw-r--r-- | lib/ansible/vars/__init__.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/ansible/vars/__init__.py b/lib/ansible/vars/__init__.py index 13c9cc8f08..96313ef4f4 100644 --- a/lib/ansible/vars/__init__.py +++ b/lib/ansible/vars/__init__.py @@ -308,7 +308,8 @@ class VariableManager: 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) |