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

simple fix for issue 2564

when we encounter a group we've not seen before - we need
to make sure we make it a subgroup of 'all', no matter what
This commit is contained in:
Seth Vidal 2013-04-04 12:44:03 -04:00
parent 8d99ef7113
commit 2796b5ee2a

View file

@ -69,7 +69,8 @@ class InventoryParser(object):
if line.find(":vars") != -1 or line.find(":children") != -1:
active_group_name = active_group_name.rsplit(":", 1)[0]
if active_group_name not in self.groups:
self.groups[active_group_name] = Group(name=active_group_name)
new_group = self.groups[active_group_name] = Group(name=active_group_name)
all.add_child_group(new_group)
active_group_name = None
elif active_group_name not in self.groups:
new_group = self.groups[active_group_name] = Group(name=active_group_name)