[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH 1/2] Remove the last usage of the system-config-date in Anaconda



We now don't use the system-config-date's timezone map and the only
remaining thing we use sdate for is determining if some string is a
valid timezone. This can be easily replaced and thus scdate can be
removed from anaconda dependencies and the installation image.
---
 pyanaconda/kickstart.py    |   10 ++--------
 pyanaconda/localization.py |    3 +++
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
index 89b0c0a..d8abaac 100644
--- a/pyanaconda/kickstart.py
+++ b/pyanaconda/kickstart.py
@@ -44,9 +44,9 @@ import urlgrabber
 import network
 import pykickstart.commands as commands
 from storage.devices import *
-from scdate.core import zonetab
 from pyanaconda import keyboard
 from pyanaconda import ntp
+from pyanaconda import localization
 
 from pykickstart.base import KickstartCommand
 from pykickstart.constants import *
@@ -1008,15 +1008,9 @@ class Services(commands.services.FC6_Services):
 
 class Timezone(commands.timezone.FC6_Timezone):
     def execute(self):
-        # check validity
-        tab = zonetab.ZoneTab()
-        if self.timezone not in (entry.tz.replace(' ','_') for entry in
-                                 tab.getEntries()):
+        if not localization.is_valid_timezone(self.timezone):
             log.warning("Timezone %s set in kickstart is not valid." % (self.timezone,))
 
-        self.anaconda.timezone.setTimezoneInfo(self.timezone, self.isUtc)
-        self.anaconda.dispatch.skip_steps("timezone")
-
         chronyd_conf_path = os.path.normpath(ROOT_PATH + ntp.NTP_CONFIG_FILE)
         ntp.save_servers_to_config(self.ntp_servers,
                                    conf_file_path=chronyd_conf_path)
diff --git a/pyanaconda/localization.py b/pyanaconda/localization.py
index 1e667a6..1c90b64 100644
--- a/pyanaconda/localization.py
+++ b/pyanaconda/localization.py
@@ -301,3 +301,6 @@ def get_all_regions_and_timezones():
             result[parts[0]].add(parts[1])
 
     return result
+
+def is_valid_timezone(timezone):
+    return timezone in pytz.common_timezones
-- 
1.7.4.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]