Commits

Rodrigo Bistolfi committed 9ae914d

timezone: do not use os.remove(). Pass root as parameter

  • Participants
  • Parent commits c06f122

Comments (0)

Files changed (2)

File vinstall/backend/timezone.py

         raise RuntimeError("Invalid timezone: %s" % tz)
     src = os.path.join(ZONEINFO, tz)
     dst = os.path.join(root, LOCAL_TZ)
-    os.remove(dst)
     return os.symlink(src, dst)
 
 
     if t not in ("UTC", "localtime"):
         raise RuntimeError("Time must be 'UTC' or 'localtime'")
     conf = os.path.join(root, "/etc/hardwareclock")
-    os.remove(conf)
     with open(conf, "w") as hwc:
         hwc.write("# /etc/hardwareclock - vinstall\n")
         hwc.write(t)

File vinstall/controller/usersetup.py

             yield self.create_user_account, (username, password), "Setting passwords"
         yield self.fstab, tuple(), "Creating fstab"
         yield self.setup_services, tuple(), "Setting up services"
-        yield timezone.set_timezone, (self.timezones[tz],), "Setting timezone"
-        yield timezone.set_hw_clock, (self.hw_clock_options[hwclock],), "Setting hardware clock"
+        yield timezone.set_timezone, (self.timezones[tz], "/mnt/TARGET"), "Setting timezone"
+        yield timezone.set_hw_clock, (self.hw_clock_options[hwclock],
+                "/mnt/TARGET"), "Setting hardware clock"
 
     def set_root_password(self, rootpassword):
         """Set the root password