mirror of
https://github.com/ansible/awx.git
synced 2026-02-25 15:06:02 -03:30
per-jt most recent fact scan gathering
* Remove system tracking piggybacked most-recent-fact-gathering * Add explicit per-jobtemplate configurable fact gathering * Continue to support system tracking * Fixed a bug where we weren't ack()ing system tracking rabbit msgs
This commit is contained in:
@@ -7,7 +7,6 @@ from django.db import models
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from awx.main.fields import JSONBField
|
||||
from awx.main.models import Host
|
||||
|
||||
__all__ = ('Fact',)
|
||||
|
||||
@@ -65,14 +64,6 @@ class Fact(models.Model):
|
||||
|
||||
@staticmethod
|
||||
def add_fact(host_id, module, timestamp, facts):
|
||||
try:
|
||||
host = Host.objects.get(id=host_id)
|
||||
except Host.DoesNotExist as e:
|
||||
logger.warn("Host with id %s not found while trying to update latest fact set." % host_id)
|
||||
raise e
|
||||
|
||||
host.update_ansible_facts(module=module, facts=facts, timestamp=timestamp)
|
||||
|
||||
fact_obj = Fact.objects.create(host_id=host_id, module=module, timestamp=timestamp, facts=facts)
|
||||
fact_obj.save()
|
||||
return fact_obj
|
||||
|
||||
Reference in New Issue
Block a user