mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
do not error in case of empty list constructed group (#53748)
This commit is contained in:
committed by
Brian Coca
parent
14d670573a
commit
8c2037aaa9
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user