summaryrefslogtreecommitdiffstats
path: root/abs/mv-core/MythVantage-config/timezip.py
diff options
context:
space:
mode:
Diffstat (limited to 'abs/mv-core/MythVantage-config/timezip.py')
-rwxr-xr-xabs/mv-core/MythVantage-config/timezip.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/abs/mv-core/MythVantage-config/timezip.py b/abs/mv-core/MythVantage-config/timezip.py
index 18f338f..bf6b389 100755
--- a/abs/mv-core/MythVantage-config/timezip.py
+++ b/abs/mv-core/MythVantage-config/timezip.py
@@ -1,4 +1,5 @@
#!/usr/bin/python
+# -*- coding: utf-8 -*-
# import MySQL module
#used to import the zipcode/timezone/nfs info fromMBE
import MySQLdb
@@ -45,7 +46,10 @@ def selectvars():
# execute SQL statement
cursor.execute("select hostname from settings where value='BackendServerIP' and data=(%s)",(masterdb))
result = cursor.fetchone()
- BEhostname=result[0]
+ try:
+ BEhostname=result[0]
+ except TypeError:
+ BEhostname=""
cursor.execute("select data from settings where value='HostZipcode' and hostname=(%s)",(BEhostname))
result = cursor.fetchone()
@@ -87,7 +91,7 @@ def selectvars():
try:
tz_region=result[0]
except TypeError:
- tz=""
+ tz_region=""
tempsubregion="HostTimeZoneRegion_" + tz_region
cursor.execute("select data from settings where value=%s and hostname=(%s)",(tempsubregion,BEhostname))