mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 03:10:42 -03:30
Fix an issue with ansible 2.0 and our fact cacher
This will be dependent on a PR submitted to core for 2.0 also: https://github.com/ansible/ansible/pull/12695 So will not work right away unless you are pulling from devel.
This commit is contained in:
parent
523a96ebce
commit
4dc56e5d66
@ -49,7 +49,6 @@ except ImportError:
|
||||
class CacheModule(BaseCacheModule):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
||||
# Basic in-memory caching for typical runs
|
||||
self._cache = {}
|
||||
self._cache_prev = {}
|
||||
@ -111,16 +110,15 @@ class CacheModule(BaseCacheModule):
|
||||
module = self.identify_new_module(key, value)
|
||||
# Assume ansible fact triggered the set if no new module found
|
||||
facts = self.filter_ansible_facts(value) if not module else dict({ module : value[module]})
|
||||
|
||||
self._cache_prev = deepcopy(self._cache)
|
||||
self._cache[key] = value
|
||||
|
||||
self._cache_prev = deepcopy(self._cache)
|
||||
packet = {
|
||||
'host': key,
|
||||
'inventory_id': os.environ['INVENTORY_ID'],
|
||||
'facts': facts,
|
||||
'date_key': self.date_key,
|
||||
}
|
||||
|
||||
# Emit fact data to tower for processing
|
||||
self.socket.send_json(packet)
|
||||
self.socket.recv()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user