allow deferrable_actions exceptions to device deferrals

This commit is contained in:
Oliver Gorwits
2023-08-12 19:51:05 +01:00
parent a78870c49f
commit bb15abce58
5 changed files with 18 additions and 8 deletions

View File

@@ -14,10 +14,10 @@ register_worker({ phase => 'check', driver => 'direct' }, sub {
and (not blessed $job->device or not $job->device->in_storage)) {
config->{'snmp_try_slow_connect'} = false;
return Status->info("running with fast SNMP timeouts for initial discover");
debug "running with fast SNMP timeouts for initial discover";
}
return Status->info("running with configured SNMP timeouts");
debug "running with configured SNMP timeouts";
});
true;

View File

@@ -22,7 +22,7 @@ register_worker({ phase => 'check' }, sub {
return Status->error('Missing device (-d).')
unless defined shift->device;
return Status->info("snapshot skipped: please run a loadmibs job first")
return Status->defer("snapshot skipped: please run a loadmibs job first")
unless schema('netdisco')->resultset('SNMPObject')->count();
return Status->done('Snapshot is able to run');

View File

@@ -67,10 +67,10 @@ sub _make_new {
return $new;
}
sub done { shift->_make_new('done', @_) }
sub info { shift->_make_new('info', @_) }
sub defer { shift->_make_new('defer', @_) }
sub error { shift->_make_new('error', @_) }
sub done { shift->_make_new('done', @_) } # <- jq_complete
sub info { shift->_make_new('info', @_) } # <- jq_complete
sub defer { shift->_make_new('defer', @_) } # <- jq_defer
sub error { shift->_make_new('error', @_) } # <- jq_complete
=head2 is_ok