-Add softoff to blade and ipmi rpower implementations

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2330 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2008-10-13 15:16:41 +00:00
parent 472bf007d6
commit e95f4c53e9
2 changed files with 23 additions and 19 deletions

View File

@ -1496,6 +1496,13 @@ sub power {
}
my $old_stat=$stat;
if ($subcommand eq "softoff") {
$validsub=1;
$data = $session->set(new SNMP::Varbind([".".$powerchangeoid,$slot,2,'INTEGER']));
unless ($data) { return (1,$session->{ErrorStr}); }
$stat = "softoff";
if ($old_stat eq "off") { $stat .= " $status_noop"; }
}
if ($subcommand eq "off") {
$validsub=1;
$data = $session->set(new SNMP::Varbind([".".$powerchangeoid,$slot,0,'INTEGER']));

View File

@ -533,26 +533,9 @@ sub ipmicmd {
elsif($subcommand eq "nmi") {
($rc,$text) = power("nmi");
}
elsif($subcommand eq "off") {
#
# e325 hack
#
# my $mfg_id;
# my $prod_id;
# my $device_id;
# my $text0;
#
# ($rc,$text,$mfg_id,$prod_id,$device_id) = getdevid();
#
# if(0 && $mfg_id == 2 && ($prod_id == 0x8835 || $prod_id == 8835) && $device_id == 0) {
# ($rc,$text0) = power("reset");
# sleep(5);
# }
#
# e325 hack end
#
elsif($subcommand eq "off" or $subcommand eq "softoff") {
my ($oldrc,$oldtext) = power("stat");
($rc,$text) = power("off");
($rc,$text) = power($subcommand);
if(($rc == 0) && ($text eq "off") && ($oldtext eq "off")) { $text .= " $status_noop"; }
# if($text0 ne "") {
@ -1315,6 +1298,9 @@ sub power {
elsif($subcommand eq "on") {
@cmd = (0x02,0x01);
}
elsif($subcommand eq "softoff") {
@cmd = (0x02,0x05);
}
elsif($subcommand eq "off") {
@cmd = (0x02,0x00);
}
@ -1379,6 +1365,17 @@ sub power {
$text = $codes{$code};
}
}
if($subcommand eq "softoff") {
$code = $returnd[36-$authoffset];
if($code == 0x00) {
$text="softoff";
}
else {
$rc = 1;
$text = $codes{$code};
}
}
if($subcommand eq "off") {
$code = $returnd[36-$authoffset];