From d34595d7e4103ec4c4f275d6a2b6da50b0cb2103 Mon Sep 17 00:00:00 2001 From: Mike Hiretsky Date: Tue, 16 Nov 2010 16:45:36 +0300 Subject: [PATCH] Change detect timezone. --- pym/cl_fill_install.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pym/cl_fill_install.py b/pym/cl_fill_install.py index fa879ac..6a2031a 100644 --- a/pym/cl_fill_install.py +++ b/pym/cl_fill_install.py @@ -638,14 +638,15 @@ class fillVars(object, glob_attr): """timezone for clock""" zoneinfodir = "/usr/share/zoneinfo/" localtimefile = "/etc/localtime" + timezonefile = "/etc/timezone" # try get timezone from kernel calculate param timezone = self.getValueFromCmdLine("calculate",2) if timezone and \ path.exists(path.join(zoneinfodir,timezone)): return timezone - # get timezone from localtime symlink - if path.islink(localtimefile): - return os.readlink(localtimefile).replace(zoneinfodir,"") + # get timezone from /etc/timezone + if path.exists(timezonefile): + return open(timezonefile,"r").read().strip() return "UTC" def get_os_install_clock_type(self):