diff --git a/Dev/Nagios/thruk.py b/Dev/Nagios/thruk.py index b90468329..08cc66edf 100755 --- a/Dev/Nagios/thruk.py +++ b/Dev/Nagios/thruk.py @@ -62,7 +62,7 @@ def getData(key, value): for v in values: try: jsondata = getData(group[:-1], v) - except requests.exceptions.ConnectionError as e: + except requests.exceptions.ConnectionError: errOut("Unable to connect to %s" % NAGIOS_HOST) for service in jsondata: dns_name = service['host_name'].split('.') diff --git a/Web/putio.5m.py b/Web/putio.5m.py index a595be35f..7857b176f 100755 --- a/Web/putio.5m.py +++ b/Web/putio.5m.py @@ -77,10 +77,10 @@ def getdir(pid): transfers = json.loads(str(r.content,encoding='utf-8'))['transfers'] r = requests.get(BURL+'/account/info?oauth_token='+OAUTH_TOKEN) info = json.loads(str(r.content,encoding='utf-8'))['info'] -except requests.exceptions.ConnectionError as msg: +except requests.exceptions.ConnectionError: print('Error connecting to put.io | color=red') sys.exit() -except json.decoder.JSONDecodeError as msg: +except json.decoder.JSONDecodeError: print('JSON Error: see /tmp/putio.log | color=red') with open('/tmp/putio.log', 'w') as fh: fh.write(str(r.content,encoding='utf-8'))