Add a hidden ripmi directive for debug and development support

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@12088 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2012-04-02 13:40:37 +00:00
parent 7bef9e3d4b
commit f7d4b54e7c

View File

@ -52,6 +52,7 @@ sub handled_commands {
rsetboot => 'nodehm:mgt', #done
rbeacon => 'nodehm:mgt', #done
reventlog => 'nodehm:mgt',
ripmi => 'ipmi',
# rfrurewrite => 'nodehm:mgt', #deferred, doesn't even work on several models, no one asks about it, keeping it commented for future requests
getrvidparms => 'nodehm:mgt' #done
}
@ -484,6 +485,8 @@ sub on_bmc_connect {
return;
}
return power($sessdata);
} elsif ($command eq "ripmi") {
return ripmi($sessdata);
} elsif ($command eq "rspreset") {
return resetbmc($sessdata);
} elsif($command eq "rbeacon") {
@ -1149,6 +1152,31 @@ sub getrvidparms_with_buildid {
}
sub ripmi { #implement generic raw ipmi commands
my $sessdata = shift;
my $netfun = hex(shift @{$sessdata->{extraargs}});
my $command = hex(shift @{$sessdata->{extraargs}});
my @data;
foreach (@{$sessdata->{extraargs}}) {
push @data,hex($_);
}
$sessdata->{ipmisession}->subcmd(netfn=>$netfun,command=>$command,data=>\@data,callback=>\&ripmi_callback,callback_args=>$sessdata);
}
sub ripmi_callback {
if (check_rsp_errors(@_)) {
return;
}
my $rsp = shift;
my $sessdata = shift;
if ($rsp->{error}) {
xCAT::SvrUtils::sendmsg([1,$rsp->{error}],$callback,$sessdata->{node},%allerrornodes);
return;
}
my $output=sprintf("%02X "x(scalar(@{$rsp->{data}})),@{$rsp->{data}});
xCAT::SvrUtils::sendmsg($output,$callback,$sessdata->{node},%allerrornodes);
}
sub power {
my $sessdata = shift;