X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=pcucontrol%2Fmodels%2FBayTech.py;h=b4bf71df9061497cb4778500d7d3daf3b6a29246;hb=40884a302bf204a7f42044b72d87f9431ad6dd35;hp=1b5522866b001c1979e78a70dfe536962cd08eb0;hpb=cb01884d466b6250c1f7351e3b68c7c8a3699c62;p=monitor.git diff --git a/pcucontrol/models/BayTech.py b/pcucontrol/models/BayTech.py index 1b55228..b4bf71d 100644 --- a/pcucontrol/models/BayTech.py +++ b/pcucontrol/models/BayTech.py @@ -22,6 +22,31 @@ class BayTechRPC3NC(PCUControl): self.transport.close() return 0 +class BayTechGeorgeTown(PCUControl): + supported_ports = [22,23] + def run_telnet(self, node_port, dryrun): + return self.run_ssh(node_port, dryrun) + def run_ssh(self, node_port, dryrun): + # NOTE: The georgetown pcu always drops the first connection, + self.transport.open(self.host, self.username, None, "Enter user name:") + self.transport.close() + time.sleep(1) + self.transport.open(self.host, self.username, None, "Enter user name:") + self.transport.sendPassword(self.password, "Enter Password:") + + self.transport.ifThenSend("RPC-16>", "Reboot %d" % node_port) + + # Reboot Outlet N (Y/N)? + if dryrun: + self.transport.ifThenSend("(Y/N)?", "N") + else: + self.transport.ifThenSend("(Y/N)?", "Y") + self.transport.ifThenSend("RPC-16>", "") + + self.transport.close() + return 0 + + class BayTechRPC16(PCUControl): supported_ports = [22,23] def run_telnet(self, node_port, dryrun):