fix reconcile to ensure 'ungrouped'
also removed redundant 'hosts to all' as all groups already ensure that inheritance
This commit is contained in:
parent
98260f9884
commit
ad94a3a6a2
1 changed files with 1 additions and 5 deletions
|
@ -125,10 +125,6 @@ class InventoryData(object):
|
||||||
|
|
||||||
mygroups = host.get_groups()
|
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:
|
if self.groups['ungrouped'] in mygroups:
|
||||||
# clear ungrouped of any incorrectly stored by parser
|
# clear ungrouped of any incorrectly stored by parser
|
||||||
if set(mygroups).difference(set([self.groups['all'], self.groups['ungrouped']])):
|
if set(mygroups).difference(set([self.groups['all'], self.groups['ungrouped']])):
|
||||||
|
@ -137,7 +133,7 @@ class InventoryData(object):
|
||||||
elif not host.implicit:
|
elif not host.implicit:
|
||||||
# add ungrouped hosts to ungrouped, except implicit
|
# add ungrouped hosts to ungrouped, except implicit
|
||||||
length = len(mygroups)
|
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)
|
self.add_child('ungrouped', host.name)
|
||||||
|
|
||||||
# special case for implicit hosts
|
# special case for implicit hosts
|
||||||
|
|
Loading…
Reference in a new issue