Merge lp:~smoser/cloud-init/trunk.lp1543025 into lp:~cloud-init-dev/cloud-init/trunk

Proposed by Scott Moser on 2016-03-01
Status: Merged
Merged at revision: 1167
Proposed branch: lp:~smoser/cloud-init/trunk.lp1543025
Merge into: lp:~cloud-init-dev/cloud-init/trunk
Diff against target: 27 lines (+7/-1)
2 files modified
ChangeLog (+2/-0)
cloudinit/distros/__init__.py (+5/-1)
To merge this branch: bzr merge lp:~smoser/cloud-init/trunk.lp1543025
Reviewer Review Type Date Requested Status
Martin Pitt (community) Approve on 2016-03-01
cloud-init Commiters 2016-03-01 Pending
Review via email: mp+287682@code.launchpad.net

Commit message

timezone: use a symlink when updating /etc/localtime

Unless /etc/localtime is an existing file and not a symlink,
then we will symlink instead of copying the tz_file to /etc/localtime.

The copy was due to an old bug in Ubuntu, symlink should be preferred.

To post a comment you must log in.
Dimitri John Ledkov (xnox) wrote :

but this can only be fine, if /usr is mounted in the initramfs, or /usr is not a separate mount point.

Martin Pitt (pitti) wrote :

Thanks for fixing this! Maybe you want to update the commit message, as this was not really due "to an old bug in Ubuntu", but we just forgot to change this along with tzdata.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ChangeLog'
--- ChangeLog 2016-03-01 05:51:26 +0000
+++ ChangeLog 2016-03-01 17:33:06 +0000
@@ -81,6 +81,8 @@
81 - lxd: add support for setting up lxd using 'lxd init' (LP: #1522879)81 - lxd: add support for setting up lxd using 'lxd init' (LP: #1522879)
82 - Add Image Customization Parser for VMware vSphere Hypervisor82 - Add Image Customization Parser for VMware vSphere Hypervisor
83 Support. [Sankar Tanguturi]83 Support. [Sankar Tanguturi]
84 - timezone: use a symlink rather than copy for /etc/localtime
85 unless it is already a file (LP: #1543025).
8486
850.7.6:870.7.6:
86 - open 0.7.688 - open 0.7.6
8789
=== modified file 'cloudinit/distros/__init__.py'
--- cloudinit/distros/__init__.py 2015-07-22 12:06:34 +0000
+++ cloudinit/distros/__init__.py 2016-03-01 17:33:06 +0000
@@ -897,5 +897,9 @@
897 util.write_file(tz_conf, str(tz).rstrip() + "\n")897 util.write_file(tz_conf, str(tz).rstrip() + "\n")
898 # This ensures that the correct tz will be used for the system898 # This ensures that the correct tz will be used for the system
899 if tz_local and tz_file:899 if tz_local and tz_file:
900 util.copy(tz_file, tz_local)900 # use a symlink if there exists a symlink or tz_local is not present
901 if os.path.islink(tz_local) or not os.path.exists(tz_local):
902 os.symlink(tz_file, tz_local)
903 else:
904 util.copy(tz_file, tz_local)
901 return905 return