mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 12:21:26 -07:00
fixed caches (#30667)
This commit is contained in:
parent
0b8e38d022
commit
2ffe3c42bb
7 changed files with 27 additions and 22 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue