Update 'states/_modules/syncthing.py'

This commit is contained in:
Paul 2021-06-17 10:06:44 +02:00
parent 538e5e9b8d
commit fddceb4459

View File

@ -63,9 +63,10 @@ def insync(url, verify, apikey):
def restart(url, verify, apikey):
fullurl = f"{url}/rest/system/restart"
try:
req = requests.post(fullurl,
verify=verify,
headers={"X-API-Key": apikey})
req = requests.request("post",
fullurl,
verify=verify,
headers={"X-API-Key": apikey})
except (requests.exceptions.RequestException) as exc:
raise f"Exception {exc} occured"
if req.status_code == 200: