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