Fixes #19379: allow standalone id in vlan-ids range list #1516

Closed
opened 2026-04-06 02:53:58 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @Jathn on 8/5/2025

Fixes #19379: allow standalone id in vlan-ids range list

The changes made allow for VLAN id ranges to be created using both ranges, e.g. 10-15 and single numbers, e.g. 20 and any combination of these. I've also included broader test coverage and fixed a bug where the range "a-b" would previously break the UI.

Changes made:

  • Changed the instructions in NumericRangeArrayField to indicate that single numbers can be given.
  • Changed utility data function: string_to_ranges (utilities/data.py line 153) so that it properly handles all of these cases.
  • Improved test coverage of utilities.tests.test_data.RangeFunctionsTestCase.test_string_to_ranges
*Originally created by @Jathn on 8/5/2025* <!-- Thank you for your interest in contributing to NetBox! Please note that our contribution policy requires that a feature request or bug report be approved and assigned prior to opening a pull request. This helps avoid waste time and effort on a proposed change that we might not be able to accept. IF YOUR PULL REQUEST DOES NOT REFERENCE AN ISSUE WHICH HAS BEEN ASSIGNED TO YOU, IT WILL BE CLOSED AUTOMATICALLY. Please specify your assigned issue number on the line below. --> ### Fixes #19379: allow standalone id in vlan-ids range list <!-- Please include a summary of the proposed changes below. --> The changes made allow for VLAN id ranges to be created using both ranges, e.g. 10-15 and single numbers, e.g. 20 and any combination of these. I've also included broader test coverage and fixed a bug where the range "a-b" would previously break the UI. Changes made: - Changed the instructions in NumericRangeArrayField to indicate that single numbers can be given. - Changed utility data function: string_to_ranges (utilities/data.py line 153) so that it properly handles all of these cases. - Improved test coverage of utilities.tests.test_data.RangeFunctionsTestCase.test_string_to_ranges
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/netbox#1516