mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
avoid empty groups in json output (#45621)
they get confused as hosts by script plugin fixes #45601
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user