mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 03:41:25 -07:00
fix 'return false' from parse
this was abandoned early on the manger side but seems like we left behind on plugin side. more flexible extensions with yaml plugin validate data correctly for yaml/constructed fixed issue with only adding one child to keyed, the group only got the host that forced it's creation fixes #31382 fixes #31365
This commit is contained in:
parent
f2ade09dce
commit
e4c61ea9a1
5 changed files with 28 additions and 19 deletions
|
@ -88,7 +88,11 @@ class InventoryModule(BaseFileInventoryPlugin):
|
|||
raise AnsibleParserError(e)
|
||||
|
||||
if not data:
|
||||
return False
|
||||
raise AnsibleParserError('Parsed empty YAML file')
|
||||
elif not isinstance(data, MutableMapping):
|
||||
raise AnsibleParserError('YAML inventory has invalid structure, it should be a dictionary, got: %s' % type(data))
|
||||
elif data.get('plugin'):
|
||||
raise AnsibleParserError('Plugin configuration YAML file, not YAML inventory')
|
||||
|
||||
# We expect top level keys to correspond to groups, iterate over them
|
||||
# to get host, vars and subgroups (which we iterate over recursivelly)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue