Prefix import does not include VLAN #885

Closed
opened 2025-12-29 16:26:42 +01:00 by adam · 1 comment
Owner

Originally created by @royvegard on GitHub (Apr 25, 2017).

Issue type: Bug report

Python version: 2.7.12
NetBox version: 1.9.7-dev 861c8b29c0

Importing a prefix with a valid VLAN does not include the VLAN.

Steps to reproduce

  1. Create a VLAN with and ID of 100.
  2. Enter the following into the Prefix import form and submit:
    192.0.2.0/24,,,,,100,Active,,False,

The prefix will be imported but it will not include the VLAN.

I believe this was introduced in d3b16ba443. Line 239 is always executed - setting self.instance.vlan = vlan which sets it to None. I'm guessing that it should only be executed if exeption VLAN.MultipleObjectsReturned happens.

Originally created by @royvegard on GitHub (Apr 25, 2017). <!-- Please note: GitHub issues are to be used only for feature requests and bug reports. For installation assistance or general discussion, please join us on the mailing list: https://groups.google.com/forum/#!forum/netbox-discuss Please indicate "bug report" or "feature request" below. Be sure to search the existing set of issues (both open and closed) to see if a similar issue has already been raised. --> ### Issue type: Bug report <!-- If filing a bug, please indicate the version of Python and NetBox you are running. (This is not necessary for feature requests.) --> **Python version:** 2.7.12 **NetBox version:** 1.9.7-dev 861c8b29c0df07d2015fca0cd46bf1a6259ea48e Importing a prefix with a valid VLAN does not include the VLAN. ### Steps to reproduce 1. Create a VLAN with and ID of 100. 2. Enter the following into the Prefix import form and submit: `192.0.2.0/24,,,,,100,Active,,False,` The prefix will be imported but it will not include the VLAN. I believe this was introduced in d3b16ba443b0d1ca45299f6765cd92fc926c7ed0. Line 239 is always executed - setting `self.instance.vlan = vlan` which sets it to `None`. I'm guessing that it should only be executed if exeption `VLAN.MultipleObjectsReturned` happens. <!-- If filing a bug, please record the exact steps taken to reproduce the bug and any errors messages that are generated. If filing a feature request, please precisely describe the data model or workflow you would like to see implemented, and provide a use case. -->
adam added the type: bug label 2025-12-29 16:26:42 +01:00
adam closed this issue 2025-12-29 16:26:42 +01:00
Author
Owner

@jeremystretch commented on GitHub (Apr 26, 2017):

Thanks!

@jeremystretch commented on GitHub (Apr 26, 2017): Thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#885