2 from pcucontrol.reboot import *
5 class OpenIPMI(PCUControl):
7 supported_ports = [80,443,623]
9 # TODO: get exit codes to determine success or failure...
10 def run_http(self, node_port, dryrun):
11 return self.run_ipmi(node_port, dryrun)
12 def run_https(self, node_port, dryrun):
13 return self.run_ipmi(node_port, dryrun)
15 def run_ipmi(self, node_port, dryrun):
18 ipmi_cmd = "power cycle"
20 ipmi_cmd = "user list"
22 cmd = "ipmitool -I lanplus -H %s -U %s -P '%s' %s"
23 cmd = cmd % ( self.host, self.username, self.password, ipmi_cmd )
24 p = subprocess.Popen(cmd, shell=True,
25 stdin=subprocess.PIPE, stdout=subprocess.PIPE,
26 stderr=subprocess.STDOUT, close_fds=True)
27 (i,p) = (p.stdin, p.stdout)
29 #print "RESULT: ", result