blib/lib/App/Netdisco/Worker/Plugin/Internal/SNMPFastDiscover.pm untested

filter: Statementstmt 0.0% 0 / 20 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 12 MC/DCmcdc 0.0% 0 / 6 Subroutinesub 0.0% 0 / 4 Podpod n/a totaltotal 0.0% 0 / 44 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package App::Netdisco::Worker::Plugin::Internal::SNMPFastDiscover;
2  
3 use Dancer ':syntax';
4 use App::Netdisco::Worker::Plugin;
5 use aliased 'App::Netdisco::Worker::Status';
6  
7 use Scalar::Util 'blessed';
8  
9 register_worker({ phase => 'check', driver => 'direct' }, sub {
10 my ($job, $workerconf) = @_;
11  
12 # if the job is a queued job, and discover, and the first one...
13 if ($job->job and $job->action eq 'discover' and not $job->log
14 and (not blessed $job->device or not $job->device->in_storage)) {
15  
16 config->{'snmp_try_slow_connect'} = false;
17 debug "running with fast SNMP timeouts for initial discover";
18 }
19 else {
20 debug "running with configured SNMP timeouts";
21 }
22 });
23  
24 true;