mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-25 16:06:43 +00:00
Create a set of all the hosts in a group to prevent duplicates
Fixes #1516.
This commit is contained in:
@@ -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):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user