Write timezone data to /etc/sysconfig/clock
If the file /etc/sysconfig/clock exists, assume fedora style timezone config and write 'ZONE="%s' to that file. taken from git://pkgs.fedoraproject.org/cloud-init.git commit 87f33190f43d2b26cced4597e7298835024466c2 Author: Garrett Holmstrom <gholms@fedoraproject.org> Patch5: cloud-init-0.6.2-tzsysconfig.patch
This commit is contained in:
parent
e49f67f4d7
commit
724e4f4ae0
@ -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")
|
||||
|
Loading…
x
Reference in New Issue
Block a user