change SNMP to be a cached transport singleton
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package App::Netdisco::Backend::Worker::Interactive::DeviceActions;
|
||||
|
||||
use App::Netdisco::Util::SNMP 'snmp_connect_rw';
|
||||
use App::Netdisco::Core::Transport::SNMP;
|
||||
use App::Netdisco::Util::Device 'get_device';
|
||||
use App::Netdisco::Backend::Util ':all';
|
||||
|
||||
@@ -22,7 +22,7 @@ sub _set_device_generic {
|
||||
$data ||= '';
|
||||
|
||||
# snmp connect using rw community
|
||||
my $info = snmp_connect_rw($ip)
|
||||
my $info = App::Netdisco::Core::Transport::SNMP->instance->writer_for($ip)
|
||||
or return job_defer("Failed to connect to device [$ip] to update $slot");
|
||||
|
||||
my $method = 'set_'. $slot;
|
||||
|
||||
Reference in New Issue
Block a user