Merge pull request #1517 from chrismeyersfsu/fix-scan_job_time

fix scan job timestamp
This commit is contained in:
Chris Meyers
2016-04-13 15:49:13 -04:00
3 changed files with 5 additions and 5 deletions

View File

@@ -9,7 +9,7 @@ from datetime import datetime
# Django
from django.core.management.base import NoArgsCommand
from django.conf import settings
#from django.core.exceptions import Does
from django.utils import timezone
# AWX
from awx.main.models.fact import Fact
@@ -64,7 +64,7 @@ class FactCacheReceiver(object):
return None
(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
try:

View File

@@ -7,6 +7,7 @@ from datetime import datetime
import json
# Django
from django.utils import timezone
# AWX
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']
# 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()
host_obj = Host.objects.get(name=data['host'], inventory__id=data['inventory_id'])