Skip to content

Commit

Permalink
Fix setting required options for inventory plugins (ansible#42049)
Browse files Browse the repository at this point in the history
* Fix setting required options for inventory plugins

* call set_options for yaml and script plugin
  • Loading branch information
s-hertel authored and bcoca committed Jun 29, 2018
1 parent aea396f commit 44e5886
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 1 deletion.
1 change: 0 additions & 1 deletion lib/ansible/inventory/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ def _setup_inventory_plugins(self):
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)
Expand Down
1 change: 1 addition & 0 deletions lib/ansible/plugins/inventory/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ def verify_file(self, path):
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')
Expand Down
1 change: 1 addition & 0 deletions lib/ansible/plugins/inventory/yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ def parse(self, inventory, loader, path, cache=True):
''' parses the inventory file '''

super(InventoryModule, self).parse(inventory, loader, path)
self.set_options()

try:
data = self.loader.load_from_file(path, cache=False)
Expand Down

0 comments on commit 44e5886

Please sign in to comment.