Swap error and info return status from Jobs to avoid info() on error

This commit is contained in:
Oliver Gorwits
2021-09-03 21:32:48 +01:00
parent 43ce26ef3d
commit 0cbce4ab3f
3 changed files with 4 additions and 3 deletions

View File

@@ -3,6 +3,7 @@
[BUG FIXES]
* Allow port_control_reasons setting to actually work
* Swap error and info return status from Jobs to avoid info() on error
2.049003 - 2021-09-03

View File

@@ -122,7 +122,7 @@ sub finalise_status {
$job->status('error');
$job->log('failed to report from any worker!');
my $max_level = Status->error()->level;
my $max_level = Status->info()->level;
if ($job->is_cancelled and scalar @{ $job->_statuslist }) {
$job->status( $job->_statuslist->[-1]->status );

View File

@@ -98,8 +98,8 @@ sub level {
my $self = shift;
return (($self->status eq 'done') ? 4
: ($self->status eq 'defer') ? 3
: ($self->status eq 'info') ? 2
: ($self->status eq 'error') ? 1 : 0);
: ($self->status eq 'error') ? 2
: ($self->status eq 'info') ? 1 : 0);
}
1;