If no time is specified, use 120 (or the PowerOnTime host property
value) when powering on, or 10 when powering off.
This is all intended to be used like this:
HostProp_rimava0_PowerMethod nest; msw --apc6 pdu2 19; pause; ipmi rimava0m
This means:
* For power on, first turn on the APC PDU pdu2 port 19
* Wait 120s (or HostProp_rimava0_PowerOnTime)
* Then ipmi to the host name rimava0m with ADMIN/ADMIN
(or HostProp_rimava0_IpmiUser/HostProp_rimava0_IpmiPassword)
* For power off, do that in reverse, only with a 10s pause.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
sub new {
my ($class, $ho, $methname, $on, $off) = @_;
+ if (!defined $on) {
+ $on = get_host_property($ho, 'PowerOnTime', 120);
+ $off = 10;
+ }
+ $off //= $on;
return bless [ $off, $on ], $class;
}
push @$methobjs, $meth;
} elsif ($meth =~ m{^(\d+)(?:/(\d+))$}) {
require Osstest::PDU::pause;
- push @$methobjs, new Osstest::PDU::pause $ho, 'pause', $1, $2//$1;
+ push @$methobjs, new Osstest::PDU::pause $ho, 'pause', $1, $2;
} else {
push @$methobjs, get_host_method_object($ho,'PDU',$meth);
}