change community_rw to be array ref

This commit is contained in:
Oliver Gorwits
2012-12-09 17:19:21 +00:00
parent 37292a0667
commit b7c1146e5f
4 changed files with 10 additions and 23 deletions

View File

@@ -39,11 +39,8 @@ sub _set_device_generic {
return error("Verify of $slot update failed on [$ip]: $new_data");
}
# get device details from db
my $device = get_device($ip)
or return error("Updated $slot on [$ip] to [$data] but failed to update DB");
# update netdisco DB
my $device = get_device($ip);
$device->update({$slot => $data});
return done("Updated $slot on [$ip] to [$data]");

View File

@@ -40,12 +40,8 @@ sub portcontrol {
return error("Verify of [$pn] port status failed on [$ip]: $state");
}
# get device details from db
my $device = $port->device
or return error("Updated [$pn] port status on [$ip] but failed to update DB");
# update netdisco DB
$device->update({up_admin => $state});
$port->device->update({up_admin => $state});
return done("Updated [$pn] port status on [$ip] to [$state]");
}

View File

@@ -107,11 +107,8 @@ sub snmp_connect {
Debug => ($ENV{INFO_TRACE} || 0),
);
(my $comm = setting('community_rw')) =~ s/\s+//g;
my @communities = split /,/, $comm;
my $info = undef;
COMMUNITY: foreach my $c (@communities) {
COMMUNITY: foreach my $c (@{ setting('community_rw') || []}) {
try {
$info = SNMP::Info->new(%snmp_args, Community => $c);
last COMMUNITY if (