mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Fix group depth for nested groups
This commit is contained in:
@@ -36,7 +36,7 @@ class Group(object):
|
|||||||
if self == group:
|
if self == group:
|
||||||
raise Exception("can't add group to itself")
|
raise Exception("can't add group to itself")
|
||||||
self.child_groups.append(group)
|
self.child_groups.append(group)
|
||||||
group.depth = group.depth + 1
|
group.depth = max([self.depth+1, group.depth])
|
||||||
group.parent_groups.append(self)
|
group.parent_groups.append(self)
|
||||||
|
|
||||||
def add_host(self, host):
|
def add_host(self, host):
|
||||||
|
|||||||
Reference in New Issue
Block a user