mirror of
https://github.com/ansible/awx.git
synced 2026-03-26 21:35:01 -02:30
When a group only has children and no hosts/vars, still return things in hash-mode, because
Ansible is not smart enough to know that 'just children' in hash mode means anything.
This commit is contained in:
@@ -564,8 +564,14 @@ class InventoryScriptView(RetrieveAPIView):
|
||||
'children': list(children.values_list('name', flat=True)),
|
||||
'vars': group.variables_dict,
|
||||
}
|
||||
group_info = dict(filter(lambda x: bool(x[1]),
|
||||
group_info.items()))
|
||||
|
||||
# this confuses the inventory script if the group
|
||||
# has children set and no variables or hosts.
|
||||
# no other reason to do this right?
|
||||
#
|
||||
# group_info = dict(filter(lambda x: bool(x[1]),
|
||||
# group_info.items()))
|
||||
|
||||
if group_info.keys() in ([], ['hosts']):
|
||||
data[group.name] = group_info.get('hosts', [])
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user