Commit dbfad567 by Michael DeHaan

Merge pull request #3041 from sergevanginderachter/performance-groups-list

performance optimization in inventory.groups_list()
parents 5ec35fa3 0c0d6c0b
...@@ -233,7 +233,8 @@ class Inventory(object): ...@@ -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
......
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