mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
allow nontype configdata (#53365)
This commit is contained in:
@@ -39,7 +39,10 @@ class InventoryModule(BaseInventoryPlugin):
|
||||
def parse(self, inventory, loader, path, cache=True):
|
||||
config_data = loader.load_from_file(path, cache=False)
|
||||
|
||||
plugin_name = config_data.get('plugin')
|
||||
try:
|
||||
plugin_name = config_data.get('plugin', None)
|
||||
except AttributeError:
|
||||
plugin_name = None
|
||||
|
||||
if not plugin_name:
|
||||
raise AnsibleParserError("no root 'plugin' key found, '{0}' is not a valid YAML inventory plugin config file".format(path))
|
||||
|
||||
Reference in New Issue
Block a user