diff options
-rwxr-xr-x | scripts/status_script.py | 12 |
1 files 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: |