summaryrefslogtreecommitdiff
path: root/cloudinit/distros
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2016-03-03 16:54:49 -0500
committerScott Moser <smoser@ubuntu.com>2016-03-03 16:54:49 -0500
commitda39ad69e3ee240df7354eb2c2f33bdaba9194f6 (patch)
treeaf3bbaf35c2bfad074c5136bffc92caebed8fd31 /cloudinit/distros
parentf4c25ab96c572e0a503bb211a11cd2641ac321a3 (diff)
parentb1046db66bbed6a063f218992449b8abfd1ae99b (diff)
downloadvyos-cloud-init-da39ad69e3ee240df7354eb2c2f33bdaba9194f6.tar.gz
vyos-cloud-init-da39ad69e3ee240df7354eb2c2f33bdaba9194f6.zip
merge with trunk
Diffstat (limited to 'cloudinit/distros')
-rw-r--r--cloudinit/distros/__init__.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/cloudinit/distros/__init__.py b/cloudinit/distros/__init__.py
index 71884b32..8167c594 100644
--- a/cloudinit/distros/__init__.py
+++ b/cloudinit/distros/__init__.py
@@ -897,5 +897,9 @@ def set_etc_timezone(tz, tz_file=None, tz_conf="/etc/timezone",
util.write_file(tz_conf, str(tz).rstrip() + "\n")
# This ensures that the correct tz will be used for the system
if tz_local and tz_file:
- util.copy(tz_file, tz_local)
+ # use a symlink if there exists a symlink or tz_local is not present
+ if os.path.islink(tz_local) or not os.path.exists(tz_local):
+ os.symlink(tz_file, tz_local)
+ else:
+ util.copy(tz_file, tz_local)
return