Skip to content

Commit

Permalink
first make arpnip behave like other jobs towards pseudo devices
Browse files Browse the repository at this point in the history
  • Loading branch information
ollyg committed Aug 25, 2019
1 parent adf80a1 commit d2661bf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions lib/App/Netdisco/Worker/Plugin/Arpnip.pm
Expand Up @@ -16,6 +16,9 @@ register_worker({ phase => 'check' }, sub {
return Status->error("arpnip skipped: $device not yet discovered")
unless $device->in_storage;

return Status->info("macsuck skipped: $device is pseudo-device")
if $device->is_pseudo;

return Status->info("arpnip skipped: $device has no layer 3 capability")
unless $device->has_layer(3);

Expand Down
5 changes: 3 additions & 2 deletions lib/App/Netdisco/Worker/Plugin/Arpwalk.pm
Expand Up @@ -11,8 +11,9 @@ register_worker({ phase => 'main' }, sub {
my ($job, $workerconf) = @_;

my %queued = map {$_ => 1} jq_queued('arpnip');
my @devices = schema('netdisco')->resultset('Device')
->has_layer('3')->get_column('ip')->all;
my @devices = schema('netdisco')->resultset('Device')->search({
-or => [ 'vendor' => undef, 'vendor' => { '!=' => 'netdisco' }],
})->has_layer('3')->get_column('ip')->all;
my @filtered_devices = grep {!exists $queued{$_}} @devices;

jq_insert([
Expand Down
2 changes: 2 additions & 0 deletions share/schema_versions/App-Netdisco-DB-58-59-PostgreSQL.sql
Expand Up @@ -2,4 +2,6 @@ BEGIN;

ALTER TABLE users ADD COLUMN "radius" boolean DEFAULT false;

UPDATE device SET layers = NULL WHERE vendor = 'netdisco';

COMMIT;

0 comments on commit d2661bf

Please sign in to comment.