Fix setting required options for inventory plugins (#42049)

* Fix setting required options for inventory plugins

* call set_options for yaml and script plugin
pull/42123/head
Sloane Hertel 6 years ago committed by Brian Coca
parent aea396f04b
commit 44e5886385

@ -183,7 +183,6 @@ class InventoryManager(object):
for name in C.INVENTORY_ENABLED:
plugin = inventory_loader.get(name)
if plugin:
plugin.set_options()
self._inventory_plugins.append(plugin)
else:
display.warning('Failed to load inventory plugin, skipping %s' % name)

@ -85,6 +85,7 @@ class InventoryModule(BaseInventoryPlugin, Cacheable):
def parse(self, inventory, loader, path, cache=None):
super(InventoryModule, self).parse(inventory, loader, path)
self.set_options()
if cache is None:
cache = self.get_option('cache')

@ -90,6 +90,7 @@ class InventoryModule(BaseFileInventoryPlugin):
''' parses the inventory file '''
super(InventoryModule, self).parse(inventory, loader, path)
self.set_options()
try:
data = self.loader.load_from_file(path, cache=False)

Loading…
Cancel
Save