Fixed test cases

This commit is contained in:
Rick Stokkingreef
2018-11-08 12:07:07 +01:00
parent f916bd7994
commit 7dbb862673
3 changed files with 12 additions and 21 deletions

View File

@@ -294,12 +294,11 @@ class Inventory(CommonModelNameNotUnique, ResourceMixin, RelatedJobsMixin):
# Remove any empty groups
for group_name in list(data.keys()):
if group_name == 'all':
continue
if not (data.get(group_name, {}).get('hosts', []) or data.get(group_name, {}).get('children', [])):
data.pop(group_name)
# Add the all group
data['all'] = all_group
if hostvars:
data.setdefault('_meta', dict())
data['_meta'].setdefault('hostvars', dict())