network check script
This commit is contained in:
@@ -9,6 +9,14 @@ def safely_panic():
|
||||
changer = Changer(safe_state,safe_state)
|
||||
changer.stop_everything()
|
||||
|
||||
def reboot_if_network_down():
|
||||
try:
|
||||
server = Server(config.API_BASE_URL, config.CONTROLLER_ID)
|
||||
server_state = server.get_state()
|
||||
print "Got state from server: " + repr(server_state)
|
||||
except:
|
||||
print "Problem with the network!"
|
||||
commands.getoutput('/sbin/shutdown -r +3')
|
||||
|
||||
def sync():
|
||||
try:
|
||||
@@ -35,5 +43,3 @@ def sync():
|
||||
except:
|
||||
print " panicking safely ! "
|
||||
safely_panic()
|
||||
print " rebooting "
|
||||
commands.getoutput('/sbin/shutdown -r +3')
|
||||
|
||||
Reference in New Issue
Block a user