summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastermain/settings.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/toaster/toastermain/settings.py')
-rw-r--r--bitbake/lib/toaster/toastermain/settings.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/toastermain/settings.py b/bitbake/lib/toaster/toastermain/settings.py
index e26ee3c9ee..6e9d85d4c0 100644
--- a/bitbake/lib/toaster/toastermain/settings.py
+++ b/bitbake/lib/toaster/toastermain/settings.py
@@ -64,7 +64,15 @@ else:
64 for dirpath, dirnames, filenames in os.walk(ZONEINFOPATH): 64 for dirpath, dirnames, filenames in os.walk(ZONEINFOPATH):
65 for fn in filenames: 65 for fn in filenames:
66 filepath = os.path.join(dirpath, fn) 66 filepath = os.path.join(dirpath, fn)
67 zonefilelist[hashlib.md5(open(filepath).read()).hexdigest()] = filepath.lstrip(ZONEINFOPATH).strip() 67 try:
68 import pytz
69 from pytz.exceptions import UnknownTimeZoneError
70 zonename = filepath.lstrip(ZONEINFOPATH).strip()
71 if pytz.timezone(zonename) is not None:
72 zonefilelist[hashlib.md5(open(filepath).read()).hexdigest()] = zonename
73 except UnknownTimeZoneError, ValueError:
74 # we expect timezone failures here, just move over
75 pass
68 76
69 TIME_ZONE = zonefilelist[hashlib.md5(open('/etc/localtime').read()).hexdigest()] 77 TIME_ZONE = zonefilelist[hashlib.md5(open('/etc/localtime').read()).hexdigest()]
70 78