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 #3041 from sergevanginderachter/performance-groups-list

performance optimization in inventory.groups_list()
This commit is contained in:
Michael DeHaan 2013-05-28 05:14:32 -07:00
commit dbfad567bc

View file

@ -233,7 +233,8 @@ class Inventory(object):
groups[g.name] = [h.name for h in g.get_hosts()] groups[g.name] = [h.name for h in g.get_hosts()]
ancestors = g.get_ancestors() ancestors = g.get_ancestors()
for a in ancestors: for a in ancestors:
groups[a.name] = [h.name for h in a.get_hosts()] if a.name not in groups:
groups[a.name] = [h.name for h in a.get_hosts()]
self._groups_list = groups self._groups_list = groups
return self._groups_list return self._groups_list