Don't process the same host multiple times

Fixes #14259
This commit is contained in:
Toshio Kuratomi 2016-03-24 16:43:03 -07:00
parent 3de08e1bfc
commit 17e8500202

View file

@ -159,7 +159,7 @@ class InventoryDirectory(object):
if 'ungrouped' in self.groups:
ungrouped = self.groups['ungrouped']
# loop on a copy of ungrouped hosts, as we want to change that list
for host in ungrouped.hosts[:]:
for host in frozenset(ungrouped.hosts):
if len(host.groups) > 1:
host.groups.remove(ungrouped)
ungrouped.hosts.remove(host)