add tests
This commit is contained in:
@@ -72,8 +72,8 @@ sub finalise_status {
|
||||
my $max_level = Status->error()->level;
|
||||
|
||||
foreach my $status (reverse @{ $job->_statuslist }) {
|
||||
next unless $status->phase
|
||||
and $status->phase =~ m/^(?:check|early|main)$/;
|
||||
next if $status->phase
|
||||
and $status->phase !~ m/^(?:check|early|main)$/;
|
||||
|
||||
next if $status->phase eq 'check'
|
||||
and $status->level eq Status->done()->level;
|
||||
@@ -154,7 +154,7 @@ status cache. Phase slot of the Status will be set to the current phase.
|
||||
sub add_status {
|
||||
my ($job, $status) = @_;
|
||||
return unless ref $status eq 'App::Netdisco::Worker::Status';
|
||||
$status->phase( $job->_current_phase );
|
||||
$status->phase( $job->_current_phase || '' );
|
||||
push @{ $job->_statuslist }, $status;
|
||||
debug $status->log if $status->log
|
||||
and (($status->phase eq 'check')
|
||||
|
||||
@@ -28,6 +28,9 @@ sub run {
|
||||
$job->device( get_device($job->device) );
|
||||
Module::Load::load 'App::Netdisco::Worker' => $job->action;
|
||||
|
||||
# finalise job status when we exit
|
||||
my $statusguard = guard { $job->finalise_status };
|
||||
|
||||
my @newuserconf = ();
|
||||
my @userconf = @{ setting('device_auth') || [] };
|
||||
|
||||
@@ -52,9 +55,6 @@ sub run {
|
||||
my $configguard = guard { set(device_auth => \@userconf) };
|
||||
set(device_auth => \@newuserconf);
|
||||
|
||||
# finalise job status when we exit
|
||||
my $statusguard = guard { $job->finalise_status };
|
||||
|
||||
# run check phase and if there are workers then one MUST be successful
|
||||
$self->run_workers('nd2_core_check');
|
||||
return if not $job->check_passed;
|
||||
|
||||
Reference in New Issue
Block a user