1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

avoid empty groups in json output (#45621)

they get confused as hosts by script plugin

fixes #45601
This commit is contained in:
Brian Coca 2018-09-13 15:38:52 -04:00 committed by GitHub
parent e619052424
commit ddb3764039
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- avoid empty groups in ansbile-inventory JSON output as they will be interpreted as hosts

View file

@ -329,6 +329,8 @@ class InventoryCLI(CLI):
results[group.name]['vars'] = self._get_group_variables(group)
self._remove_empty(results[group.name])
if not results[group.name]:
del results[group.name]
return results