From ac78e21ee8688fe5d25903a57cc316c475db59e2 Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Thu, 17 Oct 2024 18:38:29 -0600 Subject: [PATCH] crawler: change check to exclude ethernet interfaces without IPs --- pkg/crawler/main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/crawler/main.go b/pkg/crawler/main.go index ac5b0ea..3b29bad 100644 --- a/pkg/crawler/main.go +++ b/pkg/crawler/main.go @@ -263,6 +263,9 @@ func walkManagers(rf_managers []*redfish.Manager, baseURI string) ([]Manager, er } var ethernet_interfaces []EthernetInterface for _, rf_ethernetinterface := range rf_ethernetinterfaces { + if len(rf_ethernetinterface.IPv4Addresses) <= 0 { + continue + } ethernetinterface := EthernetInterface{ URI: baseURI + rf_ethernetinterface.ODataID, MAC: rf_ethernetinterface.MACAddress, @@ -270,9 +273,6 @@ func walkManagers(rf_managers []*redfish.Manager, baseURI string) ([]Manager, er Description: rf_ethernetinterface.Description, Enabled: rf_ethernetinterface.InterfaceEnabled, } - if len(rf_ethernetinterface.IPv4Addresses) > 0 { - ethernetinterface.IP = rf_ethernetinterface.IPv4Addresses[0].Address - } ethernet_interfaces = append(ethernet_interfaces, ethernetinterface) } managers = append(managers, Manager{