avoid defer in more cases so that devices do not become skipped from all jobs
This commit is contained in:
@@ -16,10 +16,10 @@ register_worker({ phase => 'check' }, sub {
|
|||||||
return Status->error("arpnip skipped: $device not yet discovered")
|
return Status->error("arpnip skipped: $device not yet discovered")
|
||||||
unless $device->in_storage;
|
unless $device->in_storage;
|
||||||
|
|
||||||
return Status->defer("arpnip skipped: $device has no layer 3 capability")
|
return Status->info("arpnip skipped: $device has no layer 3 capability")
|
||||||
unless $device->has_layer(3);
|
unless $device->has_layer(3);
|
||||||
|
|
||||||
return Status->defer("arpnip deferred: $device is not arpnipable")
|
return Status->info("arpnip skipped: $device is not arpnipable")
|
||||||
unless is_arpnipable_now($device);
|
unless is_arpnipable_now($device);
|
||||||
|
|
||||||
return Status->done('arpnip is able to run');
|
return Status->done('arpnip is able to run');
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ register_worker({ phase => 'check' }, sub {
|
|||||||
return Status->error("discover failed: no device param (need -d ?)")
|
return Status->error("discover failed: no device param (need -d ?)")
|
||||||
if $device->ip eq '0.0.0.0';
|
if $device->ip eq '0.0.0.0';
|
||||||
|
|
||||||
return Status->defer("discover skipped: $device is pseudo-device")
|
return Status->info("discover skipped: $device is pseudo-device")
|
||||||
if $device->is_pseudo;
|
if $device->is_pseudo;
|
||||||
|
|
||||||
# runner has already called get_device to promote $job->device
|
# runner has already called get_device to promote $job->device
|
||||||
@@ -24,7 +24,7 @@ register_worker({ phase => 'check' }, sub {
|
|||||||
if $device->in_storage
|
if $device->in_storage
|
||||||
and ($job->subaction eq 'with-nodes' and not $job->username);
|
and ($job->subaction eq 'with-nodes' and not $job->username);
|
||||||
|
|
||||||
return Status->defer("discover deferred: $device is not discoverable")
|
return Status->info("discover skipped: $device is not discoverable")
|
||||||
unless is_discoverable_now($device);
|
unless is_discoverable_now($device);
|
||||||
|
|
||||||
return Status->done('Discover is able to run.');
|
return Status->done('Discover is able to run.');
|
||||||
|
|||||||
@@ -16,13 +16,13 @@ register_worker({ phase => 'check' }, sub {
|
|||||||
return Status->error("macsuck skipped: $device not yet discovered")
|
return Status->error("macsuck skipped: $device not yet discovered")
|
||||||
unless $device->in_storage;
|
unless $device->in_storage;
|
||||||
|
|
||||||
return Status->defer("macsuck skipped: $device is pseudo-device")
|
return Status->info("macsuck skipped: $device is pseudo-device")
|
||||||
if $device->is_pseudo;
|
if $device->is_pseudo;
|
||||||
|
|
||||||
return Status->defer("macsuck skipped: $device has no layer 2 capability")
|
return Status->info("macsuck skipped: $device has no layer 2 capability")
|
||||||
unless $device->has_layer(2);
|
unless $device->has_layer(2);
|
||||||
|
|
||||||
return Status->defer("macsuck deferred: $device is not macsuckable")
|
return Status->info("macsuck skipped: $device is not macsuckable")
|
||||||
unless is_macsuckable_now($device);
|
unless is_macsuckable_now($device);
|
||||||
|
|
||||||
return Status->done('Macsuck is able to run.');
|
return Status->done('Macsuck is able to run.');
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ register_worker({ phase => 'check' }, sub {
|
|||||||
return Status->error('nbtstat failed: unable to interpret device param')
|
return Status->error('nbtstat failed: unable to interpret device param')
|
||||||
unless defined $job->device;
|
unless defined $job->device;
|
||||||
|
|
||||||
return Status->defer(sprintf 'nbtstat deferred: %s is not macsuckable', $job->device->ip)
|
return Status->info(sprintf 'nbtstat skipped: %s is not macsuckable', $job->device->ip)
|
||||||
unless is_macsuckable($job->device);
|
unless is_macsuckable($job->device);
|
||||||
|
|
||||||
return Status->done('Nbtstat is able to run.');
|
return Status->done('Nbtstat is able to run.');
|
||||||
|
|||||||
@@ -97,8 +97,9 @@ A numeric constant for the status, to allow comparison.
|
|||||||
sub level {
|
sub level {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
return (($self->status eq 'done') ? 4
|
return (($self->status eq 'done') ? 4
|
||||||
: ($self->status eq 'info') ? 3
|
: ($self->status eq 'defer') ? 3
|
||||||
: ($self->status eq 'defer') ? 2 : 1);
|
: ($self->status eq 'info') ? 2
|
||||||
|
: ($self->status eq 'error') ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|||||||
Reference in New Issue
Block a user