Do not attempt Canonical IP change to non-discoverable IP [skip ci]
This commit is contained in:
@@ -7,6 +7,7 @@ use aliased 'App::Netdisco::Worker::Status';
|
||||
use App::Netdisco::Transport::SNMP ();
|
||||
use App::Netdisco::Util::Permission 'check_acl_only';
|
||||
use App::Netdisco::Util::DNS 'ipv4_from_hostname';
|
||||
use App::Netdisco::Util::Device 'is_discoverable';
|
||||
use Dancer::Plugin::DBIC 'schema';
|
||||
|
||||
register_worker({ phase => 'main', driver => 'snmp' }, sub {
|
||||
@@ -46,6 +47,12 @@ register_worker({ phase => 'main', driver => 'snmp' }, sub {
|
||||
if (check_acl_only($device, $key)
|
||||
and check_acl_only($alias, $map->{$key})) {
|
||||
|
||||
if (not is_discoverable( $alias->alias )) {
|
||||
debug sprintf ' [%s] device - cannot renumber to %s - not discoverable',
|
||||
$old_ip, $alias->alias;
|
||||
next;
|
||||
}
|
||||
|
||||
if (App::Netdisco::Transport::SNMP->test_connection( $alias->alias )) {
|
||||
$new_ip = $alias->alias;
|
||||
last ALIAS;
|
||||
|
||||
Reference in New Issue
Block a user