+ if self.type == Transport.IPAL:
+ return self.run_ipal(node_port, dryrun)
+ elif self.type == Transport.TELNET:
+ return self.run_telnet(node_port, dryrun)
+ else:
+ raise Exception("Unimplemented Transport for IPAL")
+
+ def run_telnet(self, node_port, dryrun):
+ # TELNET version of protocol...
+ self.open(self.host)
+ ## XXX Some iPals require you to hit Enter a few times first
+ self.ifThenSend("Password >", "\r\n\r\n", ExceptionNotFound)
+ # Login
+ self.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.ifThenSend("Enter >",
+ "P7", # % node_port,
+ ExceptionNotFound)
+ print "send newlines"
+ self.transport.write("\r\n\r\n")
+ print "after new lines"
+ # Get the next prompt
+ print "wait for enter"
+ self.ifElse("Enter >", ExceptionTimeout)
+ print "closing "
+ self.close()
+ return 0
+
+ def run_ipal(self, node_port, dryrun):