Update 'states/_modules/syncthing.py'
This commit is contained in:
parent
538e5e9b8d
commit
fddceb4459
@ -63,9 +63,10 @@ def insync(url, verify, apikey):
|
|||||||
def restart(url, verify, apikey):
|
def restart(url, verify, apikey):
|
||||||
fullurl = f"{url}/rest/system/restart"
|
fullurl = f"{url}/rest/system/restart"
|
||||||
try:
|
try:
|
||||||
req = requests.post(fullurl,
|
req = requests.request("post",
|
||||||
verify=verify,
|
fullurl,
|
||||||
headers={"X-API-Key": apikey})
|
verify=verify,
|
||||||
|
headers={"X-API-Key": apikey})
|
||||||
except (requests.exceptions.RequestException) as exc:
|
except (requests.exceptions.RequestException) as exc:
|
||||||
raise f"Exception {exc} occured"
|
raise f"Exception {exc} occured"
|
||||||
if req.status_code == 200:
|
if req.status_code == 200:
|
||||||
|
Loading…
Reference in New Issue
Block a user