move nodelist.kid headers into node_template.kid to remove redundancy.
[monitor.git] / pcucontrol / models / IPAL.py
index a2ea026..8929946 100644 (file)
@@ -21,7 +21,10 @@ class IPAL(PCUControl):
                        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])
+                       elif e[0] == errno.ETIMEDOUT:
+                               raise ExceptionTimeout(e[1])
                        else:
                                # TODO: not other exceptions.
                                raise Exception(e)
@@ -46,13 +49,14 @@ class IPAL(PCUControl):
                self.transport.open(self.host)
                ## XXX Some iPals require you to hit Enter a few times first
                self.transport.ifThenSend("Password >", "\r\n\r\n", ExceptionNotFound)
+               self.transport.ifThenSend("Password >", "\r\n\r\n", ExceptionNotFound)
                # Login
                self.transport.ifThenSend("Password >", self.password, ExceptionPassword)
                self.transport.write("\r\n\r\n")
                if not dryrun: # P# - Pulse relay
                        print "node_port %s" % node_port
                        self.transport.ifThenSend("Enter >", 
-                                                       "P7", # % node_port, 
+                                                       "P%s"%node_port, 
                                                        ExceptionNotFound)
                        print "send newlines"
                        self.transport.write("\r\n\r\n")