2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-12 17:30:19 +00:00

Merge pull request #3112 from whowutwut/openbmc_expose

[openbmc] Open rpower and rinv commands for normal xCAT use
This commit is contained in:
xuweibj
2017-05-23 13:26:08 +08:00
committed by GitHub

View File

@ -40,10 +40,9 @@ $::POWER_STATE_RESET="reset";
sub unsupported {
my $callback = shift;
if (defined($::OPENBMC_DEVEL) && ($::OPENBMC_DEVEL eq "YES")) {
xCAT::SvrUtils::sendmsg("Warning: Currently running development code, use at your own risk. Unset XCAT_OPENBMC_DEVEL to disable.", $callback);
return;
} else {
return ([ 1, "This openbmc related function is unsupported and disabled. To bypass, run the following: \n\texport XCAT_OPENBMC_DEVEL=YES" ]);
return ([ 1, "This openbmc related function is not yet supported. Please contact xCAT development team." ]);
}
}
@ -390,24 +389,16 @@ sub parse_args {
my $subcommand = $ARGV[0];
if ($command eq "rpower") {
#
# disable function until fully tested
#
$check = unsupported($callback); if (ref($check) eq "ARRAY") { return $check; }
unless ($subcommand =~ /^on$|^off$|^reset$|^boot$|^status$|^stat$|^state$/) {
return ([ 1, "Unsupported command: $command $subcommand" ]);
}
} elsif ($command eq "rinv") {
#
# disable function until fully tested
#
$check = unsupported($callback); if (ref($check) eq "ARRAY") { return $check; }
$subcommand = "all" if (!defined($ARGV[0]));
unless ($subcommand =~ /^cpu$|^dimm$|^model$|^serial$|^firm$|^mac$|^vpd$|^mprom$|^deviceid$|^guid$|^uuid$|^all$/) {
return ([ 1, "Unsupported command: $command $subcommand" ]);
}
} elsif ($command eq "getopenbmccons") {
#command for openbmc rcons
# command for openbmc rcons
} elsif ($command eq "rsetboot") {
#
# disable function until fully tested
@ -762,7 +753,7 @@ sub deal_with_response {
if ($response->status_line ne $::RESPONSE_OK) {
my $error;
if ($response->status_line eq $::RESPONSE_SERVICE_UNAVAILABLE) {
$error = "Service Unavailable";
$error = $::RESPONSE_SERVICE_UNAVAILABLE;
} else {
my $response_info = decode_json $response->content;
if ($response->status_line eq $::RESPONSE_SERVER_ERROR) {