2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-29 09:13:08 +00:00

Merge pull request #4519 from xuweibj/flash_upload

record more information when rflash upload error
This commit is contained in:
Yuan Bai 2017-12-14 12:34:25 +08:00 committed by GitHub
commit 86c2bfa652
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3813,12 +3813,18 @@ sub rflash_upload {
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);
my $curl_error = "Did not receive response from OpenBMC after running command '$curl_login_cmd'";
xCAT::SvrUtils::sendmsg([1, "$curl_error"], $callback, $node);
print RFLASH_LOG_FILE_HANDLE "$curl_error\n";
$node_info{$node}{rst} = "$curl_error";
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': $curl_login_result"], $callback, $node);
my $curl_error = "Received wrong format response for command '$curl_login_cmd': $curl_login_result";
xCAT::SvrUtils::sendmsg([1, "$curl_error"], $callback, $node);
print RFLASH_LOG_FILE_HANDLE "$curl_error\n";
$node_info{$node}{rst} = "$curl_error";
return 1;
}
if ($h->{message} eq $::RESPONSE_OK) {
@ -3837,13 +3843,19 @@ sub rflash_upload {
}
my $curl_upload_result = `$upload_cmd`;
if (!$curl_upload_result) {
xCAT::SvrUtils::sendmsg([1, "Did not receive response from OpenBMC after running command '$upload_cmd'"], $callback, $node);
my $curl_error = "Did not receive response from OpenBMC after running command '$upload_cmd'";
xCAT::SvrUtils::sendmsg([1, "$curl_error"], $callback, $node);
print RFLASH_LOG_FILE_HANDLE "$curl_error\n";
$node_info{$node}{rst} = "$curl_error";
return 1;
}
eval { $h = from_json($curl_upload_result) }; # convert command output to hash
if ($@) {
xCAT::SvrUtils::sendmsg([1, "Received wrong format response from command '$upload_cmd': $curl_upload_result"], $callback, $node);
return 1;
my $curl_error = "Received wrong format response from command '$upload_cmd': $curl_upload_result";
xCAT::SvrUtils::sendmsg([1, "$curl_error"], $callback, $node);
print RFLASH_LOG_FILE_HANDLE "$curl_error\n";
$node_info{$node}{rst} = "$curl_error";
return 1;
}
if ($h->{message} eq $::RESPONSE_OK) {
# Upload successful, display message