mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-27 04:41:26 -07:00
remove unnecessary extra conditional (thanks bcoca)
Signed-off-by: Adam Miller <maxamillion@fedoraproject.org>
This commit is contained in:
parent
4df610f961
commit
7bc7c347dd
1 changed files with 7 additions and 12 deletions
|
@ -179,17 +179,12 @@ class InventoryModule(BaseFileInventoryPlugin):
|
||||||
# Either [groupname] or [groupname:children] is sufficient to declare a group,
|
# Either [groupname] or [groupname:children] is sufficient to declare a group,
|
||||||
# but [groupname:vars] is allowed only if the # group is declared elsewhere.
|
# but [groupname:vars] is allowed only if the # group is declared elsewhere.
|
||||||
# We add the group anyway, but make a note in pending_declarations to check at the end.
|
# We add the group anyway, but make a note in pending_declarations to check at the end.
|
||||||
if state == 'vars':
|
#
|
||||||
|
# It's possible that a group is previously pending due to being defined as a child
|
||||||
# It's possible that a group is previously pending due to being
|
# group, in that case we simply pass so that the logic below to process pending
|
||||||
# defined as a child group, in that case we simply pass so that
|
# declarations will take the appropriate action for a pending child group instead of
|
||||||
# the logic below to process pending declarations will take the
|
|
||||||
# appropriate action for a pending child group instead of
|
|
||||||
# incorrectly handling it as a var state pending declaration
|
# incorrectly handling it as a var state pending declaration
|
||||||
if groupname in pending_declarations:
|
if state == 'vars' and groupname not in pending_declarations:
|
||||||
if pending_declarations[groupname]['state'] == 'children':
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
pending_declarations[groupname] = dict(line=self.lineno, state=state, name=groupname)
|
pending_declarations[groupname] = dict(line=self.lineno, state=state, name=groupname)
|
||||||
|
|
||||||
self.inventory.add_group(groupname)
|
self.inventory.add_group(groupname)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue