From 23a87f19fdb224a59d71aa9a6f03acc180ebb3f4 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Thu, 3 Jan 2019 23:29:14 +0000 Subject: [PATCH] be less strict about finding the IP for logging --- lib/App/Netdisco/DB/ResultSet/Device.pm | 3 +-- lib/App/Netdisco/DB/ResultSet/DevicePort.pm | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/App/Netdisco/DB/ResultSet/Device.pm b/lib/App/Netdisco/DB/ResultSet/Device.pm index bf3eab04..27e6defc 100644 --- a/lib/App/Netdisco/DB/ResultSet/Device.pm +++ b/lib/App/Netdisco/DB/ResultSet/Device.pm @@ -608,8 +608,7 @@ sub delete { try { $ip ||= $devices->{attrs}->{where}->{ip} }; try { $ip ||= $devices->{attrs}->{where}->{'me.ip'} }; } - die "cannot find IP address in \$devices query for delete\n" - unless $ip; + $ip ||= 'netdisco'; foreach my $set (qw/ DeviceIp diff --git a/lib/App/Netdisco/DB/ResultSet/DevicePort.pm b/lib/App/Netdisco/DB/ResultSet/DevicePort.pm index 7ae80b5a..3ae4f80f 100644 --- a/lib/App/Netdisco/DB/ResultSet/DevicePort.pm +++ b/lib/App/Netdisco/DB/ResultSet/DevicePort.pm @@ -239,8 +239,7 @@ sub delete { try { $ip ||= ${ $ports->{attrs}->{where}->{ip}->{'-in'} }->[1]->[1] }; try { $ip ||= $ports->{attrs}->{where}->{'me.ip'} }; } - die "cannot find IP address in \$ports query for delete\n" - unless $ip; + $ip ||= 'netdisco'; foreach my $set (qw/ DevicePortPower