always using utcnow on datetime objects
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Wed, 28 May 2014 15:41:29 +0000 (17:41 +0200)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Wed, 28 May 2014 15:41:29 +0000 (17:41 +0200)
sfa/managers/aggregate_manager_eucalyptus.py
sfa/storage/model.py
sfa/trust/speaksfor_util.py

index 228361d..b8c83d8 100644 (file)
@@ -644,7 +644,7 @@ class AggregateManagerEucalyptus:
                                         ramdisk_id = instRamDisk,
                                         key_pair   = instKey,
                                         inst_type  = instType,
-                                        meta       = Meta(start_time=datetime.datetime.now()))
+                                        meta       = Meta(start_time=datetime.datetime.utcnow()))
                 eucaInst.reserveInstance(conn, pubKeys)
     
         # xxx - should return altered rspec 
index 46e2dee..d50d3b6 100644 (file)
@@ -143,12 +143,12 @@ class RegRecord (Base,AlchemyObj):
         else: return GID(string=self.gid)
 
     def just_created (self):
-        now=datetime.now()
+        now=datetime.utcnow()
         self.date_created=now
         self.last_updated=now
 
     def just_updated (self):
-        now=datetime.now()
+        now=datetime.utcnow()
         self.last_updated=now
 
 #################### cross-relations tables
index 5a5fd44..9a3b3c3 100644 (file)
@@ -348,7 +348,7 @@ def create_speaks_for(tool_gid, user_gid, ma_gid, \
 
 
     credential_duration = datetime.timedelta(days=dur_days)
-    expiration = datetime.datetime.now(du_tz.tzutc()) + credential_duration
+    expiration = datetime.datetime.utcnow() + credential_duration
     expiration_str = expiration.strftime('%Y-%m-%dT%H:%M:%SZ') # FIXME: libabac can't handle .isoformat()
     version = "1.1"