From 9e95ff3bd07b6f67dca9e5b0bc77499b5af71c13 Mon Sep 17 00:00:00 2001 From: Britney Fransen Date: Wed, 17 Jan 2018 23:13:21 +0000 Subject: supplemental-web: fe_status.py: trap error if ip isn't found --- abs/core/supplemental-web/PKGBUILD | 2 +- abs/core/supplemental-web/contents/fe_status.py | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/abs/core/supplemental-web/PKGBUILD b/abs/core/supplemental-web/PKGBUILD index 4fcef9e..b68c9e7 100644 --- a/abs/core/supplemental-web/PKGBUILD +++ b/abs/core/supplemental-web/PKGBUILD @@ -1,7 +1,7 @@ pkgbase=supplemental-web pkgname=('supplemental-web' 'supplemental-web-slave') pkgver=8.5 -pkgrel=1 +pkgrel=2 arch=('i686' 'x86_64') license=('GPL') backup=('data/srv/httpd/cgi/extra.cfg.txt') diff --git a/abs/core/supplemental-web/contents/fe_status.py b/abs/core/supplemental-web/contents/fe_status.py index 439d0c5..c66d8f9 100644 --- a/abs/core/supplemental-web/contents/fe_status.py +++ b/abs/core/supplemental-web/contents/fe_status.py @@ -67,11 +67,14 @@ def mythfe_status(cursor,mythDB): fe_hostname = socket.gethostbyaddr(i)[0] except: #print "DNS lookup failed for %s" %i - fe_hostname = socket.gethostbyname(i) - ip_addr = socket.gethostbyname(i) - fe_hostname = "%s (%s)" %(fe_hostname,ip_addr) - status_dict[fe_hostname] = parse_xml(ip_addr) - + fe_hostname = i + try: + ip_addr = socket.gethostbyname(i) + fe_hostname = "%s (%s)" %(fe_hostname,ip_addr) + status_dict[fe_hostname] = parse_xml(ip_addr) + except: + fe_hostname = "%s" %fe_hostname + status_dict[fe_hostname] = parse_xml(fe_hostname) return status_dict -- cgit v0.12