allow pseudo with layer 3 to run arpnip
This commit is contained in:
		| @@ -58,8 +58,7 @@ Returns C<undef> if the connection fails. | ||||
| sub reader_for { | ||||
|   my ($class, $ip, $useclass) = @_; | ||||
|   my $device = get_device($ip) or return undef; | ||||
|   return undef if $device->in_storage | ||||
|     and $device->vendor and $device->vendor eq 'netdisco'; | ||||
|   return undef if $device->in_storage and $device->is_pseudo; | ||||
|  | ||||
|   my $readers = $class->instance->readers or return undef; | ||||
|   return $readers->{$device->ip} if exists $readers->{$device->ip}; | ||||
| @@ -108,8 +107,7 @@ Returns C<undef> if the connection fails. | ||||
| sub writer_for { | ||||
|   my ($class, $ip, $useclass) = @_; | ||||
|   my $device = get_device($ip) or return undef; | ||||
|   return undef if $device->in_storage | ||||
|     and $device->vendor and $device->vendor eq 'netdisco'; | ||||
|   return undef if $device->in_storage and $device->is_pseudo; | ||||
|  | ||||
|   my $writers = $class->instance->writers or return undef; | ||||
|   return $writers->{$device->ip} if exists $writers->{$device->ip}; | ||||
|   | ||||
| @@ -11,9 +11,8 @@ register_worker({ phase => 'main' }, sub { | ||||
|   my ($job, $workerconf) = @_; | ||||
|  | ||||
|   my %queued = map {$_ => 1} jq_queued('arpnip'); | ||||
|   my @devices = schema('netdisco')->resultset('Device')->search({ | ||||
|     -or => [ 'vendor' => undef, 'vendor' => { '!=' => 'netdisco' }], | ||||
|   })->has_layer('3')->get_column('ip')->all; | ||||
|   my @devices = schema('netdisco')->resultset('Device') | ||||
|     ->has_layer('3')->get_column('ip')->all; | ||||
|   my @filtered_devices = grep {!exists $queued{$_}} @devices; | ||||
|  | ||||
|   jq_insert([ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user