mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-21 00:01:08 +00:00
Merge pull request #12695 from matburt/fix_cache_plugins_for_v2
Fix an issue where cache plugins weren't updated in certain scenarios
This commit is contained in:
5
lib/ansible/plugins/cache/__init__.py
vendored
5
lib/ansible/plugins/cache/__init__.py
vendored
@@ -68,3 +68,8 @@ class FactCache(MutableMapping):
|
||||
def flush(self):
|
||||
""" Flush the fact cache of all keys. """
|
||||
self._plugin.flush()
|
||||
|
||||
def update(self, key, value):
|
||||
host_cache = self._plugin.get(key)
|
||||
host_cache.update(value)
|
||||
self._plugin.set(key, host_cache)
|
||||
|
||||
@@ -546,7 +546,7 @@ class VariableManager:
|
||||
self._fact_cache[host.name] = facts
|
||||
else:
|
||||
try:
|
||||
self._fact_cache[host.name].update(facts)
|
||||
self._fact_cache.update(host.name, facts)
|
||||
except KeyError:
|
||||
self._fact_cache[host.name] = facts
|
||||
|
||||
|
||||
Reference in New Issue
Block a user