diff options
| author | Scott Moser <smoser@ubuntu.com> | 2016-03-03 16:54:49 -0500 |
|---|---|---|
| committer | Scott Moser <smoser@ubuntu.com> | 2016-03-03 16:54:49 -0500 |
| commit | da39ad69e3ee240df7354eb2c2f33bdaba9194f6 (patch) | |
| tree | af3bbaf35c2bfad074c5136bffc92caebed8fd31 /cloudinit/distros | |
| parent | f4c25ab96c572e0a503bb211a11cd2641ac321a3 (diff) | |
| parent | b1046db66bbed6a063f218992449b8abfd1ae99b (diff) | |
| download | vyos-cloud-init-da39ad69e3ee240df7354eb2c2f33bdaba9194f6.tar.gz vyos-cloud-init-da39ad69e3ee240df7354eb2c2f33bdaba9194f6.zip | |
merge with trunk
Diffstat (limited to 'cloudinit/distros')
| -rw-r--r-- | cloudinit/distros/__init__.py | 6 |
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 |
