inventory group: add groups to parent_groups only once

pull/6379/head
Serge van Ginderachter 11 years ago
parent 36f55d3549
commit 1c86909875

@ -41,7 +41,12 @@ class Group(object):
if not group in self.child_groups: if not group in self.child_groups:
self.child_groups.append(group) self.child_groups.append(group)
group.depth = max([self.depth+1, group.depth]) group.depth = max([self.depth+1, group.depth])
# 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) group.parent_groups.append(self)
self.clear_hosts_cache() self.clear_hosts_cache()
def add_host(self, host): def add_host(self, host):

Loading…
Cancel
Save