Skip to content

VLAN Groups show "0 VLANS Available" following a range if the last VLAN in the range exists #20217

@aq5747

Description

@aq5747

Deployment Type

NetBox Cloud

NetBox Version

v4.3.7

Python Version

3.10

Steps to Reproduce

  1. Add a new VLAN Group with one or more child VLAN ID ranges (something like "5-6,10-20,30-35" or "1-4094")
  2. Add one or more VLANs that corresponds to the last VLAN ID in one or more of those ranges. Make sure that they are assigned to that new VLAN Group. So for "5-6,10-20,30-35" add VLANs 6, 20, 35, for "1-4094" add 4094, etc.
  3. Open the VLAN Group, go to the VLANs tab. Notice that NetBox shows "0 VLANs available" after the last defined VLAN in those ranges.

Expected Behavior

NetBox should only display "x VLANs Available" if there is at least 1 or more availble VLANs ID at the end a range, matching the behavior with IP addresses in a prefix.

Observed Behavior

The VLANs table in the VLAN Group contains an entry that displays "0 VLANs available" at the end of a range if the last VLAN in the range exists. While this is technically true, this can be confusing for a user -- at a quick glance a user may believe there is room for another VLAN, when in actuality this is not true. Furthermore, if the user clicks the "0 VLANs available" button, NetBox will try to add the next VLAN sequentially, which falls outside of the VLAN range. If the user then tries to save this page then they will get an error that this VLAN is outside of the range.

Here I created a VLAN Group with range of "5,10,15,20,25" and created and associated the five VLANs:

Image

Metadata

Metadata

Assignees

Labels

severity: lowDoes not significantly disrupt application functionality, or a workaround is availablestatus: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions