2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-17 03:40:39 +00:00

Merge pull request 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

@ -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) {