mirror of
https://github.com/ansible/awx.git
synced 2026-03-25 12:55:04 -02:30
Merge pull request #1517 from chrismeyersfsu/fix-scan_job_time
fix scan job timestamp
This commit is contained in:
@@ -9,7 +9,7 @@ from datetime import datetime
|
|||||||
# Django
|
# Django
|
||||||
from django.core.management.base import NoArgsCommand
|
from django.core.management.base import NoArgsCommand
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
#from django.core.exceptions import Does
|
from django.utils import timezone
|
||||||
|
|
||||||
# AWX
|
# AWX
|
||||||
from awx.main.models.fact import Fact
|
from awx.main.models.fact import Fact
|
||||||
@@ -64,7 +64,7 @@ class FactCacheReceiver(object):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
(module_name, facts) = self.process_facts(facts_data)
|
(module_name, facts) = self.process_facts(facts_data)
|
||||||
self.timestamp = datetime.fromtimestamp(date_key, None)
|
self.timestamp = datetime.fromtimestamp(date_key, timezone.utc)
|
||||||
|
|
||||||
# Update existing Fact entry
|
# Update existing Fact entry
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ from datetime import datetime
|
|||||||
import json
|
import json
|
||||||
|
|
||||||
# Django
|
# Django
|
||||||
|
from django.utils import timezone
|
||||||
|
|
||||||
# AWX
|
# AWX
|
||||||
from awx.main.management.commands.run_fact_cache_receiver import FactCacheReceiver
|
from awx.main.management.commands.run_fact_cache_receiver import FactCacheReceiver
|
||||||
@@ -18,7 +19,7 @@ def check_process_fact_message_module(fact_returned, data, module_name):
|
|||||||
date_key = data['date_key']
|
date_key = data['date_key']
|
||||||
|
|
||||||
# Ensure 1, and only 1, fact created
|
# Ensure 1, and only 1, fact created
|
||||||
timestamp = datetime.fromtimestamp(date_key, None)
|
timestamp = datetime.fromtimestamp(date_key, timezone.utc)
|
||||||
assert 1 == Fact.objects.all().count()
|
assert 1 == Fact.objects.all().count()
|
||||||
|
|
||||||
host_obj = Host.objects.get(name=data['host'], inventory__id=data['inventory_id'])
|
host_obj = Host.objects.get(name=data['host'], inventory__id=data['inventory_id'])
|
||||||
|
|||||||
@@ -32,7 +32,6 @@
|
|||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
import datetime
|
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
from ansible import constants as C
|
from ansible import constants as C
|
||||||
try:
|
try:
|
||||||
@@ -55,7 +54,7 @@ class CacheModule(BaseCacheModule):
|
|||||||
|
|
||||||
# This is the local tower zmq connection
|
# This is the local tower zmq connection
|
||||||
self._tower_connection = C.CACHE_PLUGIN_CONNECTION
|
self._tower_connection = C.CACHE_PLUGIN_CONNECTION
|
||||||
self.date_key = time.mktime(datetime.datetime.utcnow().timetuple())
|
self.date_key = time.time()
|
||||||
try:
|
try:
|
||||||
self.context = zmq.Context()
|
self.context = zmq.Context()
|
||||||
self.socket = self.context.socket(zmq.REQ)
|
self.socket = self.context.socket(zmq.REQ)
|
||||||
|
|||||||
Reference in New Issue
Block a user