2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-30 09:36:41 +00:00

Merge pull request #4125 from whowutwut/bmcready_state

Return NotReady when looking for bmcstate if response is not OK
This commit is contained in:
xuweibj 2017-10-23 10:57:58 +08:00 committed by GitHub
commit 61dcb9c0b8

View File

@ -1317,6 +1317,14 @@ sub deal_with_response {
if ($response->status_line ne $::RESPONSE_OK) {
my $error;
if (defined $status_info{RPOWER_STATUS_RESPONSE}{argv} and $status_info{RPOWER_STATUS_RESPONSE}{argv} =~ /bmcstate$/) {
# Handle the special case to return "NotReady" if the BMC does not return a success response.
# If the REST service is not up, it can't return "NotReady" itself, during reboot.:w
$error = "BMC NotReady";
xCAT::SvrUtils::sendmsg($error, $callback, $node);
$wait_node_num--;
return;
}
if ($response->status_line eq $::RESPONSE_SERVICE_UNAVAILABLE) {
$error = $::RESPONSE_SERVICE_UNAVAILABLE;
} elsif ($response->status_line eq $::RESPONSE_METHOD_NOT_ALLOWED) {