-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
status: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application
Description
Environment
- Python version: 3.5.3
- NetBox version: 2.6.2
Steps to Reproduce
- Add an interface (let's call it 'I1') to a device ('D1'), and then add an IP address ('A1') to that interface 'I1'
- Set the tuple (Interface-I1, IP-A1) as the primary_ip for the device 'D1'
- Assign that IP address to a new interface ('I2') owned by a different device ('D2')
- Try to set that new tuple (Interface-I2, IP-A1) as the primary IP for the device 'D2'
Expected Behavior
As far as I can reassign the IP address to a new interface (which is completely logical), I should be able to set it as primary_ip on the new device.
Observed Behavior
Response from the UI (device edit): Device with this Primary IPv4 already exists.
Response from the API (PATCH /api/dcim/devices/<device-D2_id>/):
HTTP 500:
duplicate key value violates unique constraint "dcim_device_primary_ip4_id_key"
DETAIL: Key (primary_ip4_id)=(<IP-A1_id>) already exists.
Metadata
Metadata
Assignees
Labels
status: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application