1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

find correct fact to update

* The fact cache receiver needs to look for an exact match, rather than
* a relative, most recent fact.
This commit is contained in:
Chris Meyers 2016-03-04 11:41:08 -05:00
parent 44618d4956
commit 7494b13704

View File

@ -67,7 +67,7 @@ class FactCacheReceiver(object):
self.timestamp = datetime.fromtimestamp(date_key, None) self.timestamp = datetime.fromtimestamp(date_key, None)
# Update existing Fact entry # Update existing Fact entry
fact_obj = Fact.get_host_fact(host_obj.id, module_name, self.timestamp) fact_obj = Fact.objects.filter(host__id=host_obj.id, module=module_name, timestamp=self.timestamp)
if fact_obj: if fact_obj:
fact_obj.facts = facts fact_obj.facts = facts
fact_obj.save() fact_obj.save()