From 0db749ea19af95ef883fd42afe9e70cf2174fbe8 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Mon, 23 Feb 2015 10:11:10 -0500 Subject: [PATCH] Fix up date formatting when emitting facts to the fact service --- awx/plugins/fact_caching/tower.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/awx/plugins/fact_caching/tower.py b/awx/plugins/fact_caching/tower.py index 0d9a5297b5..bb35ebaec4 100755 --- a/awx/plugins/fact_caching/tower.py +++ b/awx/plugins/fact_caching/tower.py @@ -30,13 +30,14 @@ # POSSIBILITY OF SUCH DAMAGE. import sys +import time import datetime from ansible import constants as C from ansible.cache.base import BaseCacheModule try: import zmq -except Import: +except ImportError: print("pyzmq is required") sys.exit(1) @@ -46,7 +47,7 @@ class CacheModule(BaseCacheModule): # This is the local tower zmq connection self._tower_connection = C.CACHE_PLUGIN_CONNECTION - self.date_key = datetime.datetime.utcnow() + self.date_key = time.mktime(datetime.datetime.utcnow().timetuple()) try: self.context = zmq.Context() self.socket = self.context.socket(zmq.REQ)