mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-04 15:29:10 -07:00
do not error in case of empty list constructed group (#53748)
This commit is contained in:
parent
14d670573a
commit
8c2037aaa9
2 changed files with 23 additions and 7 deletions
|
@ -429,7 +429,9 @@ class Constructable(object):
|
|||
self.inventory.add_child(parent_name, result_gname)
|
||||
|
||||
else:
|
||||
if strict:
|
||||
raise AnsibleParserError("No key or key resulted empty, invalid entry")
|
||||
# exclude case of empty list and dictionary, because these are valid constructions
|
||||
# simply no groups need to be constructed, but are still falsy
|
||||
if strict and key not in ([], {}):
|
||||
raise AnsibleParserError("No key or key resulted empty for %s in host %s, invalid entry" % (keyed.get('key'), host))
|
||||
else:
|
||||
raise AnsibleParserError("Invalid keyed group entry, it must be a dictionary: %s " % keyed)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue