fixed caches (#30667)

This commit is contained in:
Brian Coca 2017-10-19 14:23:22 -04:00 committed by GitHub
parent 0b8e38d022
commit 2ffe3c42bb
7 changed files with 27 additions and 22 deletions

View file

@ -176,9 +176,9 @@ class InventoryModule(BaseInventoryPlugin):
raise AnsibleParserError("Incorrect plugin name in file: %s" % config_data.get('plugin', 'none found'))
source_data = None
if cache and cache_key in inventory.cache:
if cache and cache_key in self._cache:
try:
source_data = inventory.cache[cache_key]
source_data = self._cache[cache_key]
except KeyError:
pass
@ -203,6 +203,6 @@ class InventoryModule(BaseInventoryPlugin):
AnsibleParserError(to_native(e))
source_data = p.stdout.read()
inventory.cache[cache_key] = to_text(source_data, errors='surrogate_or_strict')
self._cache[cache_key] = to_text(source_data, errors='surrogate_or_strict')
self._populate_from_source(source_data.splitlines(), config_data)