Add boot parameter to rpower for blade

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@20 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2007-10-30 13:25:11 +00:00
parent 72b709255e
commit 60bab458b9

View File

@ -452,7 +452,7 @@ sub power {
my $subcommand = shift;
my $data;
my $stat;
if ($subcommand eq "stat") {
if ($subcommand eq "stat" or $subcommand eq "boot") {
$data = $session->get([$powerstatoid.".".$slot]);
if ($data == 1) {
$stat = "on";
@ -465,11 +465,12 @@ sub power {
$data = $session->set(new SNMP::Varbind([".".$powerchangeoid,$slot,0,'INTEGER']));
unless ($data) { return (1,$session->{ErrorStr}); }
$stat = "off";
} elsif ($subcommand eq "on") {
}
if ($subcommand eq "on" or ($subcommand eq "boot" and $stat eq "off")) {
$data = $session->set(new SNMP::Varbind([".".$powerchangeoid,$slot,1,'INTEGER']));
unless ($data) { return (1,$session->{ErrorStr}); }
$stat = ($data ? "on" : "off");
} elsif ($subcommand eq "reset") {
} elsif ($subcommand eq "reset" or ($subcommand eq "boot" and $stat eq "on")) {
$data = $session->set(new SNMP::Varbind([".".$powerresetoid,$slot ,1,'INTEGER']));
unless ($data) { return (1,$session->{ErrorStr}); }
$stat = "reset";