mirror of
https://github.com/ansible/awx.git
synced 2026-03-20 18:37:39 -02: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:
@@ -49,7 +49,6 @@ except ImportError:
|
|||||||
class CacheModule(BaseCacheModule):
|
class CacheModule(BaseCacheModule):
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
|
|
||||||
# Basic in-memory caching for typical runs
|
# Basic in-memory caching for typical runs
|
||||||
self._cache = {}
|
self._cache = {}
|
||||||
self._cache_prev = {}
|
self._cache_prev = {}
|
||||||
@@ -111,16 +110,15 @@ class CacheModule(BaseCacheModule):
|
|||||||
module = self.identify_new_module(key, value)
|
module = self.identify_new_module(key, value)
|
||||||
# Assume ansible fact triggered the set if no new module found
|
# 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]})
|
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[key] = value
|
||||||
|
self._cache_prev = deepcopy(self._cache)
|
||||||
packet = {
|
packet = {
|
||||||
'host': key,
|
'host': key,
|
||||||
'inventory_id': os.environ['INVENTORY_ID'],
|
'inventory_id': os.environ['INVENTORY_ID'],
|
||||||
'facts': facts,
|
'facts': facts,
|
||||||
'date_key': self.date_key,
|
'date_key': self.date_key,
|
||||||
}
|
}
|
||||||
|
|
||||||
# Emit fact data to tower for processing
|
# Emit fact data to tower for processing
|
||||||
self.socket.send_json(packet)
|
self.socket.send_json(packet)
|
||||||
self.socket.recv()
|
self.socket.recv()
|
||||||
|
|||||||
Reference in New Issue
Block a user