[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[PATCH] Make kickstart timezone value check consistent with system-config-date (#483094)
- From: Radek Vykydal <rvykydal redhat com>
- To: anaconda-devel-list redhat com
- Subject: [PATCH] Make kickstart timezone value check consistent with system-config-date (#483094)
- Date: Fri, 30 Jan 2009 14:56:11 +0100
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
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]