[supervise] supression du except socket.gaierror
This commit is contained in:
parent
8a4438bdf6
commit
3ab8af7f74
1 changed files with 4 additions and 9 deletions
|
|
@ -7,7 +7,6 @@ import time
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import socket
|
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
import urllib
|
import urllib
|
||||||
|
|
@ -192,14 +191,10 @@ def supervise(since):
|
||||||
**{'path': get_path}
|
**{'path': get_path}
|
||||||
}
|
}
|
||||||
|
|
||||||
try:
|
get_resp = requests.get(
|
||||||
get_resp = requests.get(
|
url=build_url(get_url),
|
||||||
url=build_url(get_url),
|
verify=False
|
||||||
verify=False
|
)
|
||||||
)
|
|
||||||
except socket.gaierror as exc:
|
|
||||||
logger.error('Socket error : %s', exc)
|
|
||||||
sys.exit(-1)
|
|
||||||
|
|
||||||
control_data = get_resp.json()
|
control_data = get_resp.json()
|
||||||
if Heatpump(mac_address).control(control_data):
|
if Heatpump(mac_address).control(control_data):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue