diff --git a/lib/App/Netdisco/Util/Device.pm b/lib/App/Netdisco/Util/Device.pm index 9ca6361b..ae87331c 100644 --- a/lib/App/Netdisco/Util/Device.pm +++ b/lib/App/Netdisco/Util/Device.pm @@ -192,9 +192,9 @@ sub is_discoverable { =head2 is_discoverable_now( $ip, $device_type? ) -Same as C, but also checks the last_discover field if the -device is in storage, and returns false if that host has been too recently -discovered. +Same as C, but also compares the C field +of the C to the C configuration. Also checks +for pseudo devicea. Returns false if the host is not permitted to discover the target device. @@ -204,6 +204,9 @@ sub is_discoverable_now { my ($ip, $remote_type) = @_; my $device = get_device($ip) or return 0; + return _bail_msg("is_discoverable: $device is pseudo-device") + if $device->is_pseudo; + if ($device->in_storage and $device->since_last_discover and setting('discover_min_age') and $device->since_last_discover < setting('discover_min_age')) { diff --git a/lib/App/Netdisco/Worker/Plugin/Discover.pm b/lib/App/Netdisco/Worker/Plugin/Discover.pm index d65d274e..5934b8b3 100644 --- a/lib/App/Netdisco/Worker/Plugin/Discover.pm +++ b/lib/App/Netdisco/Worker/Plugin/Discover.pm @@ -16,9 +16,6 @@ register_worker({ phase => 'check' }, sub { return Status->error("discover failed: no device param (need -d ?)") if $device->ip eq '0.0.0.0'; - return Status->info("discover skipped: $device is pseudo-device") - if $device->is_pseudo; - # runner has already called get_device to promote $job->device return $job->cancel("fresh discover cancelled: $device already known") if $device->in_storage