Skip to content

Commit

Permalink
[backend] fix fatal errors not failing sign jobs
Browse files Browse the repository at this point in the history
Do not check the 'result' element, as it is set by the repo server.
Also make the error message appended to the log file more
informative.
  • Loading branch information
mlschroe committed Nov 29, 2022
1 parent 09ac6a0 commit 1053011
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/backend/bs_signer
Expand Up @@ -932,7 +932,7 @@ sub signjob {
$error = "Need an RSA key for openssl signing, please create a new key\n";
$jobstatus->{'result'} = 'failed';
}
$jobstatus->{'result'} = 'failed' if !$jobstatus->{'result'} && $error =~ s/^fatal: //;
$jobstatus->{'result'} = 'failed' if $error =~ s/^fatal: //;
if ($jobstatus->{'result'} && $jobstatus->{'result'} eq 'rebuild') {
warn("rebuilding: $error\n");
if ($info->{'followupfile'}) {
Expand All @@ -948,7 +948,7 @@ sub signjob {
}
if ($jobstatus->{'result'} && $jobstatus->{'result'} eq 'failed') {
warn("failed: $error\n");
BSUtil::appendstr("$jobdir/logfile", "\n\n$error");
BSUtil::appendstr("$jobdir/logfile", "\n\nsigning failed: $error");
$jobstatus->{'code'} = 'finished';
writexml("$jobsdir/$arch/.$job:status", "$jobsdir/$arch/$job:status", $jobstatus, $BSXML::jobstatus);
updateredisjobstatus($arch, $job, $info, 'finished');
Expand Down

0 comments on commit 1053011

Please sign in to comment.