diff options
author | Scott Moser <smoser@ubuntu.com> | 2011-01-25 01:36:01 +0000 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2011-01-25 01:36:01 +0000 |
commit | f525772c0d95057323531289418445cd7d625bb0 (patch) | |
tree | bd68170b39630c2f35d8e69d22337729eeb3c9d1 | |
parent | 516e378f0e79d127baeac8c6418efc504d3b713e (diff) | |
download | vyos-cloud-init-f525772c0d95057323531289418445cd7d625bb0.tar.gz vyos-cloud-init-f525772c0d95057323531289418445cd7d625bb0.zip |
use timestamp.gmtime() for timestamps rather than time() or datetime
-rw-r--r-- | cloudinit/CloudConfig/cc_final_message.py | 4 | ||||
-rw-r--r-- | cloudinit/DataSourceEc2.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/cloudinit/CloudConfig/cc_final_message.py b/cloudinit/CloudConfig/cc_final_message.py index febfd017..8f9dc786 100644 --- a/cloudinit/CloudConfig/cc_final_message.py +++ b/cloudinit/CloudConfig/cc_final_message.py @@ -18,6 +18,7 @@ from cloudinit.CloudConfig import per_instance import sys from cloudinit import util, boot_finished +import time frequency = per_instance @@ -39,8 +40,7 @@ def handle(name,cfg,cloud,log,args): try: - from datetime import datetime - ts = datetime.utcnow().strftime('%a, %d %b %Y %H:%M:%S +0000') + ts = time.strftime("%a, %d %b %Y %H:%M:%S %z",time.gmtime()) except: ts = "na" diff --git a/cloudinit/DataSourceEc2.py b/cloudinit/DataSourceEc2.py index fc8fac5a..1c0edc59 100644 --- a/cloudinit/DataSourceEc2.py +++ b/cloudinit/DataSourceEc2.py @@ -108,7 +108,7 @@ class DataSourceEc2(DataSource.DataSource): cloudinit.log.warning("waiting for metadata service at %s\n" % url) cloudinit.log.warning(" %s [%02s/%s]: %s\n" % - (time.strftime("%H:%M:%S"), x+1, sleeps, reason)) + (time.strftime("%H:%M:%S",time.gmtime()), x+1, sleeps, reason)) time.sleep(sleeptime) cloudinit.log.critical("giving up on md after %i seconds\n" % |