Verify expect versions of DRAC, HPiLO and updates to APCControl, & OpenIPMI
[pcucontrol.git] / pcucontrol / models / DRAC.py
1 from pcucontrol.reboot import *
2 import time
3
4 class DRAC(BasicPCUControl):
5     supported_ports = [22,443,5869]
6     def run_drac(self, node_port, dryrun):
7         return self.run_expect_script("DRAC.exp racadm", dryrun=dryrun, model="None")
8
9     def run_ssh(self, node_port, dryrun):
10         return self.run_expect_script("DRAC.exp ssh", dryrun=dryrun, model="None")
11
12     def pcu_run(self, node_port, dryrun=False):
13         r = self.run_ssh(node_port, dryrun=False)
14         if "No error" in r:
15             return r
16         r2 = self.run_drac(node_port, dryrun=False)
17         if "No error" in r2:
18             return r2
19         return r + " :: " +r2
20
21     def pcu_test(self, node_port, dryrun=True):
22         r = self.run_ssh(node_port, dryrun=True)
23         if "No error" in r:
24             return r
25         r2 = self.run_drac(node_port, dryrun=True)
26         if "No error" in r2:
27             return r2
28         return r + " :: " +r2