allow contact|location|portname|snapshot to run on pseudo devices
This commit is contained in:
@@ -4,7 +4,7 @@ use Dancer qw/:moose :syntax :script/;
|
|||||||
use Dancer::Plugin::DBIC 'schema';
|
use Dancer::Plugin::DBIC 'schema';
|
||||||
|
|
||||||
use App::Netdisco::Util::Device
|
use App::Netdisco::Util::Device
|
||||||
qw/is_discoverable is_macsuckable is_arpnipable/;
|
qw/get_device is_discoverable is_macsuckable is_arpnipable/;
|
||||||
use App::Netdisco::Backend::Job;
|
use App::Netdisco::Backend::Job;
|
||||||
|
|
||||||
use Module::Load ();
|
use Module::Load ();
|
||||||
@@ -33,9 +33,20 @@ sub _get_denied_actions {
|
|||||||
my $device = shift;
|
my $device = shift;
|
||||||
my @badactions = ();
|
my @badactions = ();
|
||||||
return @badactions unless $device;
|
return @badactions unless $device;
|
||||||
|
$device = get_device($device); # might be no-op but is done in is_* anyway
|
||||||
|
|
||||||
push @badactions, ('discover', @{ setting('job_prio')->{high} })
|
if ($device->is_pseudo) {
|
||||||
if not is_discoverable($device);
|
# always let pseudo devices do contact|location|portname|snapshot
|
||||||
|
# and additionally if there's a snapshot cache, is_discoverable will let
|
||||||
|
# them do all other discover and high prio actions
|
||||||
|
push @badactions, ('discover', grep { $_ !~ m/^(?:contact|location|portname|snapshot)$/ }
|
||||||
|
@{ setting('job_prio')->{high} })
|
||||||
|
if not is_discoverable($device);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
push @badactions, ('discover', @{ setting('job_prio')->{high} })
|
||||||
|
if not is_discoverable($device);
|
||||||
|
}
|
||||||
|
|
||||||
push @badactions, (qw/macsuck nbtstat/)
|
push @badactions, (qw/macsuck nbtstat/)
|
||||||
if not is_macsuckable($device);
|
if not is_macsuckable($device);
|
||||||
|
|||||||
@@ -371,24 +371,25 @@ schedule:
|
|||||||
|
|
||||||
job_prio:
|
job_prio:
|
||||||
high:
|
high:
|
||||||
|
- contact
|
||||||
- hook::exec
|
- hook::exec
|
||||||
- hook::http
|
- hook::http
|
||||||
- location
|
- location
|
||||||
- contact
|
|
||||||
- portcontrol
|
- portcontrol
|
||||||
- portname
|
- portname
|
||||||
- vlan
|
|
||||||
- power
|
- power
|
||||||
|
- snapshot
|
||||||
|
- vlan
|
||||||
normal:
|
normal:
|
||||||
- discoverall
|
|
||||||
- discover
|
|
||||||
- arpwalk
|
|
||||||
- arpnip
|
- arpnip
|
||||||
- macwalk
|
- arpwalk
|
||||||
- macsuck
|
- discover
|
||||||
- nbtwalk
|
- discoverall
|
||||||
- nbtstat
|
|
||||||
- expire
|
- expire
|
||||||
|
- macsuck
|
||||||
|
- macwalk
|
||||||
|
- nbtstat
|
||||||
|
- nbtwalk
|
||||||
- stats
|
- stats
|
||||||
|
|
||||||
worker_plugins:
|
worker_plugins:
|
||||||
|
|||||||
Reference in New Issue
Block a user