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

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

Create a set of all the hosts in a group to prevent duplicates
This commit is contained in:
Michael DeHaan 2012-11-14 06:32:17 -08:00
commit 73ae930659

View file

@ -50,11 +50,11 @@ class Group(object):
def get_hosts(self):
hosts = []
hosts = set()
for kid in self.child_groups:
hosts.extend(kid.get_hosts())
hosts.extend(self.hosts)
return hosts
hosts.update(kid.get_hosts())
hosts.update(self.hosts)
return list(hosts)
def get_variables(self):