fix reconcile to ensure 'ungrouped'

also removed redundant 'hosts to all' as all groups already ensure that inheritance
pull/32876/head
Brian Coca 7 years ago committed by Brian Coca
parent 98260f9884
commit ad94a3a6a2

@ -125,10 +125,6 @@ class InventoryData(object):
mygroups = host.get_groups()
# ensure hosts are always in 'all'
if 'all' not in mygroups and not host.implicit:
self.add_child('all', host.name)
if self.groups['ungrouped'] in mygroups:
# clear ungrouped of any incorrectly stored by parser
if set(mygroups).difference(set([self.groups['all'], self.groups['ungrouped']])):
@ -137,7 +133,7 @@ class InventoryData(object):
elif not host.implicit:
# add ungrouped hosts to ungrouped, except implicit
length = len(mygroups)
if length == 0 or (length == 1 and all in mygroups):
if length == 0 or (length == 1 and self.groups['all'] in mygroups):
self.add_child('ungrouped', host.name)
# special case for implicit hosts

Loading…
Cancel
Save