mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
minor protection against bad config
This commit is contained in:
parent
8432ba80c1
commit
9831e1597f
1 changed files with 4 additions and 2 deletions
|
@ -182,8 +182,10 @@ class InventoryManager(object):
|
|||
|
||||
for name in C.INVENTORY_ENABLED:
|
||||
plugin = inventory_loader.get(name)
|
||||
name = os.path.splitext(os.path.basename(plugin._original_path))[0]
|
||||
self._inventory_plugins.append(plugin)
|
||||
if plugin:
|
||||
self._inventory_plugins.append(plugin)
|
||||
else:
|
||||
display.warning('Failed to load inventory plugin, skipping %s' % name)
|
||||
|
||||
if not self._inventory_plugins:
|
||||
raise AnsibleError("No inventory plugins available to generate inventory, make sure you have at least one whitelisted.")
|
||||
|
|
Loading…
Reference in a new issue