61e820d97fa2b6d632fab60afc2adc1f8b2645ab
[pcucontrol.git] / pcucontrol / models / IntelAMT.py
1 from pcucontrol.reboot import *
2 from distutils.sysconfig import get_python_lib; 
3
4 class IntelAMT(PCUControl):
5         supported_ports = [16992]
6
7         def run_amt(self, node_port, dryrun):
8
9                 cmd = command.CMD()
10                 # TODO: need to make this path universal; not relative to pwd.
11                 cmd_str = get_python_lib(1) + "/pcucontrol/models/intelamt/remoteControl"
12
13                 if dryrun:
14                         # NOTE: -p checks the power state of the host.
15                         # TODO: parse the output to find out if it's ok or not.
16                         cmd_str += " -p http://%s:16992/RemoteControlService  -user admin -pass '%s' " % (self.host, self.password )
17                 else:
18                         cmd_str += " -A http://%s:16992/RemoteControlService -user admin -pass '%s' " % (self.host, self.password )
19                         
20                 print cmd_str
21                 return cmd.system(cmd_str, Transport.TELNET_TIMEOUT)