mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00: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:
@@ -129,21 +129,18 @@ class InventoryModule(BaseInventoryPlugin):
|
||||
except Exception as e:
|
||||
raise AnsibleParserError(e)
|
||||
|
||||
msg = ''
|
||||
if not self._config_data:
|
||||
# empty. this is not my config file
|
||||
return False
|
||||
if 'plugin' in self._config_data and self._config_data['plugin'] != self.NAME:
|
||||
# plugin config file, but not for us
|
||||
return False
|
||||
msg = 'File empty. this is not my config file'
|
||||
elif 'plugin' in self._config_data and self._config_data['plugin'] != self.NAME:
|
||||
msg = 'plugin config file, but not for us: %s' % self._config_data['plugin']
|
||||
elif 'plugin' not in self._config_data and 'clouds' not in self._config_data:
|
||||
# it's not a clouds.yaml file either
|
||||
return False
|
||||
msg = "it's not a plugin configuration nor a clouds.yaml file"
|
||||
elif not HAS_SHADE:
|
||||
msg = "shade is required for the OpenStack inventory plugin. OpenStack inventory sources will be skipped."
|
||||
|
||||
if not HAS_SHADE:
|
||||
self.display.warning(
|
||||
'shade is required for the OpenStack inventory plugin.'
|
||||
' OpenStack inventory sources will be skipped.')
|
||||
return False
|
||||
if msg:
|
||||
raise AnsibleParserError(msg)
|
||||
|
||||
# The user has pointed us at a clouds.yaml file. Use defaults for
|
||||
# everything.
|
||||
|
||||
Reference in New Issue
Block a user