From b2901994e4310c255a6edf64dcf35c7bf12295ef Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Wed, 10 Oct 2012 16:51:18 -0700 Subject: Add comments as to a future refactoring of this function that needs to occur since its pretty much the same now. --- cloudinit/distros/debian.py | 5 ++++- cloudinit/distros/rhel.py | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'cloudinit/distros') diff --git a/cloudinit/distros/debian.py b/cloudinit/distros/debian.py index 20962937..c8b13f95 100644 --- a/cloudinit/distros/debian.py +++ b/cloudinit/distros/debian.py @@ -111,7 +111,9 @@ class Distro(distros.Distro): return "127.0.1.1" def set_timezone(self, tz): - tz_file = os.path.join(self.tz_zone_dir, tz) + # TODO(harlowja): move this code into + # the parent distro... + tz_file = os.path.join(self.tz_zone_dir, str(tz)) if not os.path.isfile(tz_file): raise RuntimeError(("Invalid timezone %s," " no file found at %s") % (tz, tz_file)) @@ -122,6 +124,7 @@ class Distro(distros.Distro): "", ] 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) def package_command(self, command, args=None): diff --git a/cloudinit/distros/rhel.py b/cloudinit/distros/rhel.py index 21f2216e..45c85fbb 100644 --- a/cloudinit/distros/rhel.py +++ b/cloudinit/distros/rhel.py @@ -186,8 +186,8 @@ class Distro(distros.Distro): return distros.Distro._bring_up_interfaces(self, device_names) def set_timezone(self, tz): - # Ensure that this timezone is actually - # available on this system, if not give up + # TODO(harlowja): move this code into + # the parent distro... tz_file = os.path.join(self.tz_zone_dir, str(tz)) if not os.path.isfile(tz_file): raise RuntimeError(("Invalid timezone %s," -- cgit v1.2.3