community data now deleted with devices

This commit is contained in:
Oliver Gorwits
2016-10-03 22:18:47 +01:00
parent 9227e8cde8
commit 6c17fe65b8
2 changed files with 2 additions and 12 deletions

View File

@@ -583,22 +583,13 @@ sub delete {
DeviceVlan DeviceVlan
DevicePower DevicePower
DeviceModule DeviceModule
Community
/) { /) {
$schema->resultset($set)->search( $schema->resultset($set)->search(
{ ip => { '-in' => $devices->as_query } }, { ip => { '-in' => $devices->as_query } },
)->delete; )->delete;
} }
$schema->resultset('Community')->search({
ip => { '-in' => $devices->as_query },
snmp_auth_tag_read => undef,
snmp_auth_tag_write => undef,
})->delete;
$schema->resultset('Community')->search(
{ ip => { '-in' => $devices->as_query } },
)->update({snmp_comm_rw => undef});
$schema->resultset('Admin')->search({ $schema->resultset('Admin')->search({
device => { '-in' => $devices->as_query }, device => { '-in' => $devices->as_query },
})->delete; })->delete;

View File

@@ -609,8 +609,7 @@ C<community> shorthand instead:
Netdisco caches both the successful SNMPv2 read and write community strings, Netdisco caches both the successful SNMPv2 read and write community strings,
as well as the C<tag> names if available. This allows for faster operations as well as the C<tag> names if available. This allows for faster operations
once a connection has already been made to a device. When you delete a device, once a connection has previously been made to a device.
the community strings are removed but the C<tag> hints remain, for future use.
=head3 C<get_community> =head3 C<get_community>