Skip to content

Commit

Permalink
Merge pull request #17 from cloudflare/mgouel/interface-units
Browse files Browse the repository at this point in the history
do not fail in case of a malformed virtual interface name
  • Loading branch information
matthieugouel authored Nov 4, 2024
2 parents 6ed5699 + f4bbd59 commit 991c90c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/connector/netbox/netbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<parent_interface_name>.<unit>` (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)
Expand Down

0 comments on commit 991c90c

Please sign in to comment.