tidy up calls to check_{node|device}_{no|only} to use only check_acl*
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
package App::Netdisco::Util::SNMP;
|
||||
|
||||
use Dancer qw/:syntax :script/;
|
||||
use App::Netdisco::Util::Device qw/get_device check_device_no/;
|
||||
use App::Netdisco::Util::Permission qw/check_acl/;
|
||||
use App::Netdisco::Util::Device 'get_device';
|
||||
use App::Netdisco::Util::Permission qw/check_acl_no check_acl/;
|
||||
|
||||
use SNMP::Info;
|
||||
use Try::Tiny;
|
||||
@@ -81,7 +81,7 @@ sub _snmp_connect_generic {
|
||||
);
|
||||
|
||||
# an override for bulkwalk
|
||||
$snmp_args{BulkWalk} = 0 if check_device_no($device, 'bulkwalk_no');
|
||||
$snmp_args{BulkWalk} = 0 if check_acl_no($device, 'bulkwalk_no');
|
||||
|
||||
# further protect against buggy Net-SNMP, and disable bulkwalk
|
||||
if ($snmp_args{BulkWalk}
|
||||
@@ -98,9 +98,9 @@ sub _snmp_connect_generic {
|
||||
|
||||
# which SNMP versions to try and in what order
|
||||
my @versions =
|
||||
( check_device_no($device->ip, 'snmpforce_v3') ? (3)
|
||||
: check_device_no($device->ip, 'snmpforce_v2') ? (2)
|
||||
: check_device_no($device->ip, 'snmpforce_v1') ? (1)
|
||||
( check_acl_no($device->ip, 'snmpforce_v3') ? (3)
|
||||
: check_acl_no($device->ip, 'snmpforce_v2') ? (2)
|
||||
: check_acl_no($device->ip, 'snmpforce_v1') ? (1)
|
||||
: (reverse (1 .. (setting('snmpver') || 3))) );
|
||||
|
||||
# use existing or new device class
|
||||
|
||||
Reference in New Issue
Block a user