From f4bbd596d66f0a7afb962ffdd6e36e60866e83b0 Mon Sep 17 00:00:00 2001 From: Matthieu Gouel Date: Mon, 4 Nov 2024 17:55:51 +0100 Subject: [PATCH] do not fail in case of a malformed virtual interface name --- pkg/connector/netbox/netbox.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/connector/netbox/netbox.go b/pkg/connector/netbox/netbox.go index 0081fbf..a6c81e0 100644 --- a/pkg/connector/netbox/netbox.go +++ b/pkg/connector/netbox/netbox.go @@ -252,7 +252,9 @@ func (n *NetboxConnector) addInterfaceUnits(t *model.Topology) error { vlanTag, err := nbUtils.ParseUnitStr(unitStr) if err != nil { - return fmt.Errorf("unable to convert unit %q (id=%d) (interface %q) to int for %s:%s. Ignoring logical interface", unitStr, nbIfa.ID, nbIfa.Name, nbIfa.Device.Name, nbIfa.Parent.Name) + // In this case the interface name is not following the convention `.` (e.g., ending with "."). + // So we ignore it. + log.Warnf("unable to convert unit %q (id=%d) (interface %q) to int for %s:%s. Ignoring.", unitStr, nbIfa.ID, nbIfa.Name, nbIfa.Device.Name, nbIfa.Parent.Name) } u := ifa.AddUnitIfNotExists(vlanTag)