From 3b22746c346e43d5cbfb925771c5c9ebd55f6c07 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Wed, 18 Oct 2017 16:37:16 -0400 Subject: [PATCH] Return NotReady when looking for bmcstate if response is not OK --- xCAT-server/lib/xcat/plugins/openbmc.pm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index cd127bc6d..2b223b6f2 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -1235,6 +1235,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) {