if first url wrong, then use api reboot method
This commit is contained in:
+2
-1
@@ -16,7 +16,8 @@ try:
|
|||||||
if response.status==401:
|
if response.status==401:
|
||||||
print "Unauthorized, Wrong PASSWORD"
|
print "Unauthorized, Wrong PASSWORD"
|
||||||
elif response.status==404:
|
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:
|
except httplib2.ServerNotFoundError:
|
||||||
print "HOST is Down"
|
print "HOST is Down"
|
||||||
except (socket.timeout, socket.error, httplib2.HttpLib2Error, httplib.ResponseNotReady):
|
except (socket.timeout, socket.error, httplib2.HttpLib2Error, httplib.ResponseNotReady):
|
||||||
|
|||||||
Reference in New Issue
Block a user