Parent interface not scoped to device on interface bulk import #5070

Closed
opened 2025-12-29 19:23:46 +01:00 by adam · 1 comment
Owner

Originally created by @sleepinggenius2 on GitHub (Jul 16, 2021).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v2.11.9

Python version

3.8

Steps to Reproduce

  1. Click on Devices > Interfaces > Import
  2. Enter the following into the CSV input:
device,name,type,parent
dev1,int1,10gbase-x-sfpp,
dev1,int1/1,virtual,int1
dev2,int1,10gbase-x-sfpp,
dev2,int1/1,virtual,int1
  1. Click Submit

Expected Behavior

The import should have completed successfully.

Observed Behavior

* Row 4 parent: "int1" is not a unique value for this field; multiple objects were found

The code only seems to scope the lag field to the device, but not the parent field.

Originally created by @sleepinggenius2 on GitHub (Jul 16, 2021). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v2.11.9 ### Python version 3.8 ### Steps to Reproduce 1. Click on `Devices > Interfaces > Import` 2. Enter the following into the CSV input: ``` device,name,type,parent dev1,int1,10gbase-x-sfpp, dev1,int1/1,virtual,int1 dev2,int1,10gbase-x-sfpp, dev2,int1/1,virtual,int1 ``` 3. Click _Submit_ ### Expected Behavior The import should have completed successfully. ### Observed Behavior ``` * Row 4 parent: "int1" is not a unique value for this field; multiple objects were found ``` The code only seems to scope the lag field to the device, but not the parent field.
adam added the type: bugstatus: accepted labels 2025-12-29 19:23:46 +01:00
adam closed this issue 2025-12-29 19:23:46 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jul 19, 2021):

Looks like the __init__() method of dcim.forms.InterfaceCSVForm needs to be extended to limit the queryset of the parent field, as we do for lag. Should be a simple fix; ideal for a new contributor.

@jeremystretch commented on GitHub (Jul 19, 2021): Looks like the `__init__()` method of [dcim.forms.InterfaceCSVForm](https://github.com/netbox-community/netbox/blob/dd0489c1c50b0709fc603e40261f144665338032/netbox/dcim/forms.py#L3335) needs to be extended to limit the queryset of the `parent` field, as we do for `lag`. Should be a simple fix; ideal for a new contributor.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5070