Change detect timezone.

netsetup
Mike Hiretsky 14 years ago
parent 2f6fd49aa5
commit d34595d7e4

@ -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):

Loading…
Cancel
Save