Skip to content

Commit

Permalink
fixes #11: support ipv6
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Falk Nielsen committed Oct 11, 2024
1 parent 8d04bf6 commit 52a9c33
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions internal/inventory/inventory.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func (i *InventorySync) getDeviceSessions(devices []netbox.DeviceWithConfigConte
return nil, err
}

ipAddress := i.getPrimaryIP(device.PrimaryIp4)
ipAddress := i.getPrimaryIP(device.PrimaryIp)
if ipAddress == nil {
return nil, fmt.Errorf("primary ip is not set on %s", device.Name)
}
Expand All @@ -127,10 +127,6 @@ func (i *InventorySync) getDeviceSessions(devices []netbox.DeviceWithConfigConte
if device.VirtualChassis != nil {
virtualChassisName = device.VirtualChassis.Name
}
virtualChassisName := ""
if device.VirtualChassis != nil {
virtualChassisName = *device.VirtualChassis.Name
}

env := i.getCommonEnvironment("device")
env.Device = device
Expand Down Expand Up @@ -175,7 +171,7 @@ func (i *InventorySync) getVirtualMachineSessions(devices []netbox.VirtualMachin
return nil, err
}

ipAddress := i.getPrimaryIP(device.PrimaryIp4)
ipAddress := i.getPrimaryIP(device.PrimaryIp)
if ipAddress == nil {
return nil, fmt.Errorf("primary ip is not set on %s", device.Name)
}
Expand Down

0 comments on commit 52a9c33

Please sign in to comment.