Better test for cache method availability (#54740)

* Better test for cache method availability

  fixes #54737

* try and ignore missing method

* avoid plugin cross contamination

* ammend clog
This commit is contained in:
Brian Coca
2019-04-09 12:32:11 -04:00
committed by Matt Davis
parent 9c5275092f
commit 5f69ab7f46
3 changed files with 17 additions and 15 deletions

View File

@@ -56,5 +56,7 @@ class InventoryModule(BaseInventoryPlugin):
raise AnsibleParserError("inventory config '{0}' could not be verified by plugin '{1}'".format(path, plugin_name))
plugin.parse(inventory, loader, path, cache=cache)
if getattr(plugin, '_cache', None):
try:
plugin.update_cache_if_changed()
except AttributeError:
pass