This function did not catch any possible errors, nor respect the
$noerr parameter.

Signed-off-by: Stefan Hanreich <s.hanre...@proxmox.com>
---
 src/PVE/Network/SDN/Ipams/NetboxPlugin.pm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/PVE/Network/SDN/Ipams/NetboxPlugin.pm 
b/src/PVE/Network/SDN/Ipams/NetboxPlugin.pm
index 6e1f78b..0d9d5a3 100644
--- a/src/PVE/Network/SDN/Ipams/NetboxPlugin.pm
+++ b/src/PVE/Network/SDN/Ipams/NetboxPlugin.pm
@@ -247,6 +247,10 @@ sub get_ips_from_mac {
     my $data = eval {
        netbox_api_request($plugin_config, "GET", 
"/ipam/ip-addresses/?description__ic=$mac/");
     };
+    if ($@) {
+       return if $noerr;
+       die "could not query ip address entry for mac $mac: $@";
+    }
 
     for my $ip (@{$data->{results}}) {
        if ($ip->{family}->{value} == 4 && !$ip4) {
-- 
2.39.5


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to