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: for name in C.INVENTORY_ENABLED:
plugin = inventory_loader.get(name) plugin = inventory_loader.get(name)
if plugin: if plugin:
plugin.set_options()
self._inventory_plugins.append(plugin) self._inventory_plugins.append(plugin)
else: else:
display.warning('Failed to load inventory plugin, skipping %s' % name) 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): def parse(self, inventory, loader, path, cache=None):
super(InventoryModule, self).parse(inventory, loader, path) super(InventoryModule, self).parse(inventory, loader, path)
self.set_options()
if cache is None: if cache is None:
cache = self.get_option('cache') cache = self.get_option('cache')

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

Loading…
Cancel
Save