fix bug where grandparent groups were excluded

This commit is contained in:
AlanCoding
2018-11-02 10:10:38 -04:00
parent 5eb4b35508
commit 47fc0a759f
2 changed files with 23 additions and 1 deletions

View File

@@ -294,7 +294,7 @@ class Inventory(CommonModelNameNotUnique, ResourceMixin, RelatedJobsMixin):
# Remove any empty groups
for group_name in list(data.keys()):
if not data.get(group_name, {}).get('hosts', []):
if not (data.get(group_name, {}).get('hosts', []) or data.get(group_name, {}).get('children', [])):
data.pop(group_name)
if hostvars: