[PATCH] Make kickstart timezone value check consistent with system-config-date (#483094)

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

 



Use zonetab module for in place of zone.tab file.
Zonetab (used by UI and s-c-date) adds some of Etc/* specifiers.
---
 kickstart.py |   13 ++++---------
 1 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/kickstart.py b/kickstart.py
index f064740..eafd4d8 100644
--- a/kickstart.py
+++ b/kickstart.py
@@ -37,6 +37,7 @@ import warnings
 import upgrade
 import pykickstart.commands as commands
 import cryptodev
+import zonetab
 from pykickstart.constants import *
 from pykickstart.errors import *
 from pykickstart.parser import *
@@ -770,15 +771,9 @@ class Timezone(commands.timezone.FC6_Timezone):
         retval = commands.timezone.FC6_Timezone.parse(self, args)
 
         # check validity
-        f = open('/usr/share/zoneinfo/zone.tab', 'r')
-        for line in f:
-            line = line.strip()
-            if line[0] == '#':
-                continue
-            fields = line.split('\t')
-            if len(fields) > 2 and fields[2] == self.timezone: 
-                break
-        else:
+        tab = zonetab.ZoneTab()
+        if self.timezone not in (entry.tz.replace(' ','_') for entry in
+                                 tab.getEntries()):
             log.warning("Timezone %s set in kickstart is not valid, will ask" % (self.timezone,))
             return retval
 
-- 
1.5.4.3

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux