mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 05:12:45 +00:00
inventory group: add groups to parent_groups only once
This commit is contained in:
@@ -41,7 +41,12 @@ class Group(object):
|
||||
if not group in self.child_groups:
|
||||
self.child_groups.append(group)
|
||||
group.depth = max([self.depth+1, group.depth])
|
||||
group.parent_groups.append(self)
|
||||
|
||||
# now add self to child's parent_groups list, but only if there
|
||||
# isn't already a group with the same name
|
||||
if not self.name in [g.name for g in group.parent_groups]:
|
||||
group.parent_groups.append(self)
|
||||
|
||||
self.clear_hosts_cache()
|
||||
|
||||
def add_host(self, host):
|
||||
|
||||
Reference in New Issue
Block a user