From dd3857727ef60db5bfdf3c4c766e543942943331 Mon Sep 17 00:00:00 2001 From: XuWei Date: Mon, 11 Dec 2017 00:25:02 -0500 Subject: [PATCH] modified depending on comments --- xCAT-server/lib/xcat/plugins/openbmc.pm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 83d90cd09..50efd7577 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -3219,9 +3219,13 @@ sub dump_download_process { my $curl_login_result = `$curl_login_cmd -s`; my $h; + if (!$curl_login_result) { + xCAT::SvrUtils::sendmsg([1, "Did not receive response from OpenBMC after running command '$curl_login_cmd'"], $callback, $node); + return 1; + } eval { $h = from_json($curl_login_result) }; if ($@) { - xCAT::SvrUtils::sendmsg([1, "Received wrong format response for command '$curl_login_cmd'"], $callback, $node); + xCAT::SvrUtils::sendmsg([1, "Received wrong format response for command '$curl_login_cmd': $curl_login_result)"], $callback, $node); return 1; } if ($h->{message} eq $::RESPONSE_OK) { @@ -3706,9 +3710,13 @@ sub rflash_upload { # Try to login my $curl_login_result = `$curl_login_cmd -s`; my $h; + if (!$curl_login_result) { + xCAT::SvrUtils::sendmsg([1, "Did not receive response from OpenBMC after running command '$curl_login_cmd'"], $callback, $node); + return 1; + } eval { $h = from_json($curl_login_result) }; # convert command output to hash if ($@) { - xCAT::SvrUtils::sendmsg([1, "Received wrong format response for command '$curl_login_cmd'"], $callback, $node); + xCAT::SvrUtils::sendmsg([1, "Received wrong format response for command '$curl_login_cmd': $curl_login_result"], $callback, $node); return 1; } if ($h->{message} eq $::RESPONSE_OK) {