X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=reboot.py;h=ba641c4724c7cea4f6670f2ef883a42949a1ef49;hb=refs%2Fheads%2F1.0;hp=67be293af08ddc40a7be0dd943bd95ceb401063f;hpb=842a7a17574e6fec92f219ceb35332a1bcafa3f7;p=monitor.git diff --git a/reboot.py b/reboot.py index 67be293..ba641c4 100755 --- a/reboot.py +++ b/reboot.py @@ -296,11 +296,12 @@ class IPAL(PCUControl): try: # TODO: make sleep backoff, before stopping. - time.sleep(4) + time.sleep(8) ret = s.recv(count, socket.MSG_DONTWAIT) except socket.error, e: if e[0] == errno.EAGAIN: - raise Exception(e[1]) + #raise Exception(e[1]) + raise ExceptionNotFound(e[1]) else: # TODO: not other exceptions. raise Exception(e) @@ -321,6 +322,8 @@ class IPAL(PCUControl): if e[0] == errno.ECONNREFUSED: # cannot connect to remote host raise Exception(e[1]) + elif e[0] == errno.ETIMEDOUT: + raise ExceptionTimeout(e[1]) else: # TODO: what other conditions are there? raise Exception(e) @@ -343,6 +346,8 @@ class IPAL(PCUControl): elif status == '0': # down power_on = False + elif status == '6': + raise ExceptionPort("IPAL reported 'Cable Error' on %s socket %s : %s" % (self.host, node_port, ret)) else: raise Exception("Unknown status for PCU %s socket %s : %s" % (self.host, node_port, ret)) else: @@ -371,6 +376,8 @@ class IPAL(PCUControl): elif status == '0': # down power_on = False + elif status == '6': + raise ExceptionPort("IPAL reported 'Cable Error' on %s socket %s : %s" % (self.host, node_port, ret)) else: raise Exception("Unknown status for PCU %s socket %s : %s" % (self.host, node_port, ret)) else: