if first url wrong, then use api reboot method

This commit is contained in:
2020-06-10 21:46:46 +08:00
parent 5d6dc6374f
commit 635880b482
+2 -1
View File
@@ -16,7 +16,8 @@ try:
if response.status==401:
print "Unauthorized, Wrong PASSWORD"
elif response.status==404:
print "Wrong Request Address"
URL = "http://"+sys.argv[1]+"/api/reboot"
response, content = h.request(URL, "GET", headers={'cache-control':'no-cache'})
except httplib2.ServerNotFoundError:
print "HOST is Down"
except (socket.timeout, socket.error, httplib2.HttpLib2Error, httplib.ResponseNotReady):