-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
NetBox version
v3.0.4
Python version
3.8
Steps to Reproduce
Only tested v3.0.4, but don't see any relevant changelogs on more recent versions.
- Create a device
- Import an IP address via CSV, and specify 'device' and 'is_primary'
address,status,device,is_primary
1.1.1.1/32,active,my_device,true
Expected Behavior
The CSV import should fail if is_primary is defined without a valid device and interface pair being defined.
or
Primary IPs should not be dependent on being assigned to an interface, but rather any defined IP object should be valid.
Observed Behavior
Created IP address object does not indicate that it is assigned to a device:

Device shows that a primary IP is assigned, despite that IP not being assigned to an interface.


Editing my_device details results in the primary IP being removed.
Bulk editing a range of devices that includes my_device (i.e. to add a tag) results in the error my_device failed validation: The specified IP address (1.1.1.1/32) is not assigned to this device.
Deleting the imported IP does properly remove the primary IP from the device (I half expected that to fail somehow).