Add os_clock_timezone variable for store current timezone.

develop
Mike Hiretsky 13 years ago
parent 366dd8940d
commit 3ca3bdbf08

@ -715,3 +715,18 @@ class fillVars(varsShare):
def get_cl_ca_path(self):
"""CA path"""
return '/var/calculate/ssl/main'
def get_os_clock_timezone(self):
"""Current clock timezone"""
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 /etc/timezone
if path.exists(timezonefile):
return open(timezonefile,"r").read().strip()
return "UTC"

@ -103,6 +103,9 @@ class Data:
# system (desktop or server)
os_linux_system = {'hide':True}
# current timezone
os_clock_timezone = {'hide':True}
# motherboard model
hr_board_model = {'hide':True}

Loading…
Cancel
Save