Skip to content

Commit

Permalink
Merge branch 'main' into fix/tag-description
Browse files Browse the repository at this point in the history
  • Loading branch information
bl4ko authored Feb 20, 2025
2 parents 42a111d + 7c9ba33 commit 0472b1f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 19 deletions.
32 changes: 14 additions & 18 deletions internal/netbox/inventory/init_items.go
Original file line number Diff line number Diff line change
Expand Up @@ -946,15 +946,13 @@ func (nbi *NetboxInventory) initIPAddresses(ctx context.Context) error {
)
for i := range ipAddresses {
ipAddr := &ipAddresses[i]
if ipAddr.HasTag(nbi.SsotTag) {
ifaceType, ifaceName, ifaceParentName, err := nbi.getIndexValuesForIPAddress(ipAddr)
if err != nil {
return fmt.Errorf("get index values for ip address: %s", err)
}
nbi.verifyIPAddressIndexExists(ifaceType, ifaceName, ifaceParentName)
nbi.ipAddressesIndex[ifaceType][ifaceName][ifaceParentName][ipAddr.Address] = ipAddr
nbi.OrphanManager.AddItem(ipAddr)
ifaceType, ifaceName, ifaceParentName, err := nbi.getIndexValuesForIPAddress(ipAddr)
if err != nil {
return fmt.Errorf("get index values for ip address: %s", err)
}
nbi.verifyIPAddressIndexExists(ifaceType, ifaceName, ifaceParentName)
nbi.ipAddressesIndex[ifaceType][ifaceName][ifaceParentName][ipAddr.Address] = ipAddr
nbi.OrphanManager.AddItem(ipAddr)
}

nbi.Logger.Debug(
Expand All @@ -980,17 +978,15 @@ func (nbi *NetboxInventory) initMACAddresses(ctx context.Context) error {
)
for i := range nbMACAddresses {
macAddress := &nbMACAddresses[i]
if macAddress.HasTag(nbi.SsotTag) {
ifaceType, ifaceName, ifaceParentName, err := nbi.getIndexValuesForMACAddress(
macAddress,
)
if err != nil {
return fmt.Errorf("get index values for mac address: %s", err)
}
nbi.verifyMACAddressIndexExists(ifaceType, ifaceName, ifaceParentName)
nbi.macAddressesIndex[ifaceType][ifaceName][ifaceParentName][macAddress.MAC] = macAddress
nbi.OrphanManager.AddItem(macAddress)
ifaceType, ifaceName, ifaceParentName, err := nbi.getIndexValuesForMACAddress(
macAddress,
)
if err != nil {
return fmt.Errorf("get index values for mac address: %s", err)
}
nbi.verifyMACAddressIndexExists(ifaceType, ifaceName, ifaceParentName)
nbi.macAddressesIndex[ifaceType][ifaceName][ifaceParentName][macAddress.MAC] = macAddress
nbi.OrphanManager.AddItem(macAddress)
}

nbi.Logger.Debug(
Expand Down
2 changes: 1 addition & 1 deletion internal/netbox/service/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func Patch[T any](
ctx,
"Patching %T with path %s with data: %v",
dummy,
objectPath,
path,
body,
)

Expand Down

0 comments on commit 0472b1f

Please sign in to comment.