summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--cloudinit/distros/__init__.py6
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index b31148ac..2f1f9f87 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -81,6 +81,8 @@
- lxd: add support for setting up lxd using 'lxd init' (LP: #1522879)
- Add Image Customization Parser for VMware vSphere Hypervisor
Support. [Sankar Tanguturi]
+ - timezone: use a symlink rather than copy for /etc/localtime
+ unless it is already a file (LP: #1543025).
0.7.6:
- open 0.7.6
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