Handle management IP of one device being in use on another device
This commit is contained in:
@@ -15,6 +15,7 @@
|
|||||||
* Show netdisco-do docs on options error
|
* Show netdisco-do docs on options error
|
||||||
* Do not leak SNMP community string into debug output (unless SHOW_COMMUNITY=1)
|
* Do not leak SNMP community string into debug output (unless SHOW_COMMUNITY=1)
|
||||||
* Process tree updated to show daemon worker status/activity
|
* Process tree updated to show daemon worker status/activity
|
||||||
|
* Handle management IP of one device being in use on another device
|
||||||
|
|
||||||
[BUG FIXES]
|
[BUG FIXES]
|
||||||
|
|
||||||
|
|||||||
@@ -49,8 +49,12 @@ sub get_device {
|
|||||||
# naive check for existing DBIC object
|
# naive check for existing DBIC object
|
||||||
return $ip if ref $ip;
|
return $ip if ref $ip;
|
||||||
|
|
||||||
my $alias = schema('netdisco')->resultset('DeviceIp')
|
# in case the management IP of one device is in use on another device,
|
||||||
->search({alias => $ip})->first;
|
# we first try to get an exact match for the IP as mgmt interface.
|
||||||
|
my $alias =
|
||||||
|
schema('netdisco')->resultset('DeviceIp')->find($ip, $ip)
|
||||||
|
||
|
||||||
|
schema('netdisco')->resultset('DeviceIp')->search({alias => $ip})->first;
|
||||||
$ip = $alias->ip if defined $alias;
|
$ip = $alias->ip if defined $alias;
|
||||||
|
|
||||||
return schema('netdisco')->resultset('Device')->with_times
|
return schema('netdisco')->resultset('Device')->with_times
|
||||||
|
|||||||
Reference in New Issue
Block a user