Do not attempt Canonical IP change to non-discoverable IP [skip ci]
This commit is contained in:
4
Changes
4
Changes
@@ -4,6 +4,10 @@
|
|||||||
|
|
||||||
* #332 Autodiscovery via BGP and OSPF peers
|
* #332 Autodiscovery via BGP and OSPF peers
|
||||||
|
|
||||||
|
[ENHANCEMENTS]
|
||||||
|
|
||||||
|
* Do not attempt Canonical IP change to non-discoverable IP
|
||||||
|
|
||||||
2.038034 - 2018-01-31
|
2.038034 - 2018-01-31
|
||||||
|
|
||||||
[NEW FEATURES]
|
[NEW FEATURES]
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ use aliased 'App::Netdisco::Worker::Status';
|
|||||||
use App::Netdisco::Transport::SNMP ();
|
use App::Netdisco::Transport::SNMP ();
|
||||||
use App::Netdisco::Util::Permission 'check_acl_only';
|
use App::Netdisco::Util::Permission 'check_acl_only';
|
||||||
use App::Netdisco::Util::DNS 'ipv4_from_hostname';
|
use App::Netdisco::Util::DNS 'ipv4_from_hostname';
|
||||||
|
use App::Netdisco::Util::Device 'is_discoverable';
|
||||||
use Dancer::Plugin::DBIC 'schema';
|
use Dancer::Plugin::DBIC 'schema';
|
||||||
|
|
||||||
register_worker({ phase => 'main', driver => 'snmp' }, sub {
|
register_worker({ phase => 'main', driver => 'snmp' }, sub {
|
||||||
@@ -46,6 +47,12 @@ register_worker({ phase => 'main', driver => 'snmp' }, sub {
|
|||||||
if (check_acl_only($device, $key)
|
if (check_acl_only($device, $key)
|
||||||
and check_acl_only($alias, $map->{$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 )) {
|
if (App::Netdisco::Transport::SNMP->test_connection( $alias->alias )) {
|
||||||
$new_ip = $alias->alias;
|
$new_ip = $alias->alias;
|
||||||
last ALIAS;
|
last ALIAS;
|
||||||
|
|||||||
Reference in New Issue
Block a user