mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 05:10:22 -07:00
avoid empty groups in json output (#45621)
they get confused as hosts by script plugin fixes #45601
This commit is contained in:
parent
e619052424
commit
ddb3764039
2 changed files with 4 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue