Commit 73ae9306 by Michael DeHaan

Merge pull request #1623 from dhozac/group-hosts-set

Create a set of all the hosts in a group to prevent duplicates
parents 44af1408 17e4ce97
...@@ -50,11 +50,11 @@ class Group(object): ...@@ -50,11 +50,11 @@ class Group(object):
def get_hosts(self): def get_hosts(self):
hosts = [] hosts = set()
for kid in self.child_groups: for kid in self.child_groups:
hosts.extend(kid.get_hosts()) hosts.update(kid.get_hosts())
hosts.extend(self.hosts) hosts.update(self.hosts)
return hosts return list(hosts)
def get_variables(self): def get_variables(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment