summaryrefslogtreecommitdiff
path: root/cloudinit/CloudConfig/cc_timezone.py
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/CloudConfig/cc_timezone.py')
-rw-r--r--cloudinit/CloudConfig/cc_timezone.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/cloudinit/CloudConfig/cc_timezone.py b/cloudinit/CloudConfig/cc_timezone.py
index a26df8f9..e8a453f9 100644
--- a/cloudinit/CloudConfig/cc_timezone.py
+++ b/cloudinit/CloudConfig/cc_timezone.py
@@ -45,6 +45,13 @@ def handle(name,cfg,cloud,log,args):
except:
log.debug("failed to write to /etc/timezone")
raise
+ if os.path.exists("/etc/sysconfig/clock"):
+ try:
+ with open("/etc/sysconfig/clock", "w") as fp:
+ fp.write('ZONE="%s"\n' % timezone)
+ except:
+ log.debug("failed to write to /etc/sysconfig/clock")
+ raise
try:
shutil.copy(tz_file, "/etc/localtime")