device_tracker.ubus: catch ConnectionError (#14045)

When an OpenWrt device monitored via ubus is offline, this causes the
log to be flooded with several exceptions. Avoid this by catching
requests.exceptions.ConnectionError in addition to
requests.exceptions.Timeout.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
This commit is contained in:
Stijn Tintel 2018-04-22 13:55:45 +03:00 committed by Daniel Høyer Iversen
parent 86374ad809
commit 1fbc650871

View file

@ -207,7 +207,7 @@ def _req_json_rpc(url, session_id, rpcmethod, subsystem, method, **params):
try:
res = requests.post(url, data=data, timeout=5)
except requests.exceptions.Timeout:
except (requests.exceptions.ConnectionError, requests.exceptions.Timeout):
return
if res.status_code == 200: