minor protection against bad config

pull/25373/head
Brian Coca 8 years ago
parent 8432ba80c1
commit 9831e1597f

@ -182,8 +182,10 @@ class InventoryManager(object):
for name in C.INVENTORY_ENABLED: for name in C.INVENTORY_ENABLED:
plugin = inventory_loader.get(name) plugin = inventory_loader.get(name)
name = os.path.splitext(os.path.basename(plugin._original_path))[0] if plugin:
self._inventory_plugins.append(plugin) self._inventory_plugins.append(plugin)
else:
display.warning('Failed to load inventory plugin, skipping %s' % name)
if not self._inventory_plugins: if not self._inventory_plugins:
raise AnsibleError("No inventory plugins available to generate inventory, make sure you have at least one whitelisted.") raise AnsibleError("No inventory plugins available to generate inventory, make sure you have at least one whitelisted.")

Loading…
Cancel
Save