summaryrefslogtreecommitdiff
path: root/cloudinit/distros/debian.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2014-07-29 09:52:02 -0400
committerScott Moser <smoser@ubuntu.com>2014-07-29 09:52:02 -0400
commit67428ad5a66ee57d1212e5af74cb9e9ed81d2c7b (patch)
treee3ece15c3b28e3cc0ce26b8fe81d72fda1cf7ca8 /cloudinit/distros/debian.py
parent4b8397a510c4ff6f903e98bef50d350410f41451 (diff)
downloadvyos-cloud-init-67428ad5a66ee57d1212e5af74cb9e9ed81d2c7b.tar.gz
vyos-cloud-init-67428ad5a66ee57d1212e5af74cb9e9ed81d2c7b.zip
do not put comments in /etc/timezone
comments in /etc/timezone are not expected, and can cause problems if another tool tries to read it. LP: #1341710
Diffstat (limited to 'cloudinit/distros/debian.py')
-rw-r--r--cloudinit/distros/debian.py13
1 files changed, 1 insertions, 12 deletions
diff --git a/cloudinit/distros/debian.py b/cloudinit/distros/debian.py
index 1ae232fd..7cf4a9ef 100644
--- a/cloudinit/distros/debian.py
+++ b/cloudinit/distros/debian.py
@@ -46,8 +46,6 @@ class Distro(distros.Distro):
hostname_conf_fn = "/etc/hostname"
locale_conf_fn = "/etc/default/locale"
network_conf_fn = "/etc/network/interfaces"
- tz_conf_fn = "/etc/timezone"
- tz_local_fn = "/etc/localtime"
def __init__(self, name, cfg, paths):
distros.Distro.__init__(self, name, cfg, paths)
@@ -133,16 +131,7 @@ class Distro(distros.Distro):
return "127.0.1.1"
def set_timezone(self, tz):
- tz_file = self._find_tz_file(tz)
- # Note: "" provides trailing newline during join
- tz_lines = [
- util.make_header(),
- str(tz),
- "",
- ]
- util.write_file(self.tz_conf_fn, "\n".join(tz_lines))
- # This ensures that the correct tz will be used for the system
- util.copy(tz_file, self.tz_local_fn)
+ set_etc_timezone(tz=tz, tz_file=self._find_tz_file(tz))
def package_command(self, command, args=None, pkgs=None):
if pkgs is None: