From a2a8d4d14981607349897da6e52464aad6b3689f Mon Sep 17 00:00:00 2001 From: Christian Franke Date: Mon, 11 May 2015 06:34:06 +0200 Subject: Add fix ip for doorstatus as dns is currently v6 only --- scripts/status_script.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/status_script.py b/scripts/status_script.py index 1b30d01..cc247ec 100755 --- a/scripts/status_script.py +++ b/scripts/status_script.py @@ -14,10 +14,14 @@ class SublabStatus(object): def get_json(self): if self.json is not None: return self.json - - with contextlib.closing(urllib.urlopen('http://beaglebone.local.sublab.org/')) as response: - self.json = json.load(response) - return self.json + try: + with contextlib.closing(urllib.urlopen('http://[2a02:238:f02a:9800:caa0:30ff:feb4:2185]/')) as response: + self.json = json.load(response) + return self.json + except IOError: + with contextlib.closing(urllib.urlopen('http://beaglebone.local.sublab.org/')) as response: + self.json = json.load(response) + return self.json def door_status(self): try: -- cgit v1.2.1