no need to search for device - IP should already be exact

This commit is contained in:
Oliver Gorwits
2013-03-31 13:45:27 +01:00
parent b42daee4c1
commit a8dde50343

View File

@@ -1,9 +1,9 @@
package App::Netdisco::Util::DeviceProperties; package App::Netdisco::Util::DeviceProperties;
use Dancer qw/:syntax :script/; use Dancer qw/:syntax :script/;
use Dancer::Plugin::DBIC 'schema';
use NetAddr::IP::Lite ':lower'; use NetAddr::IP::Lite ':lower';
use App::Netdisco::Util::Connect 'get_device';
use base 'Exporter'; use base 'Exporter';
our @EXPORT = (); our @EXPORT = ();
@@ -40,8 +40,7 @@ Returns false if the host is not permitted to discover the target device.
sub is_discoverable { sub is_discoverable {
my $q = shift; my $q = shift;
my $device = schema('netdisco')->resultset('Device') my $device = get_device($q) or return 0;
->search_for_device($q) or return 0;
my $addr = NetAddr::IP::Lite->new($device->ip); my $addr = NetAddr::IP::Lite->new($device->ip);
my $discover_no = setting('discover_no') || []; my $discover_no = setting('discover_no') || [];