[PR #3865] [MERGED] Fixes #3623: Word expansion for interfaces #12670

Closed
opened 2025-12-29 22:22:57 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/3865
Author: @hSaria
Created: 1/8/2020
Status: Merged
Merged: 1/10/2020
Merged by: @jeremystretch

Base: developHead: 3623-interface-word-expansion


📝 Commits (9)

  • eb40275 Fixes #3623: Word expansion for interfaces
  • 396bb28 Added example and handled invalid ranges gracefully
  • 094553d Merge branch 'develop' into 3623-interface-word-expansion
  • c13b9d8 Added tests for IPv4
  • fe89982 Removed redundant list call
  • 2eba84d Added tests for IPv6
  • acb66c7 Negative tests for expand_ipaddress_pattern
  • 71120d9 Added tests for alphanumeric
  • a5413a5 Merge branch 'develop' into 3623-interface-word-expansion

📊 Changes

3 files changed (+295 additions, -2 deletions)

View changed files

📝 docs/release-notes/version-2.6.md (+1 -0)
📝 netbox/utilities/forms.py (+11 -2)
netbox/utilities/tests/test_forms.py (+283 -0)

📄 Description

Fixes: #3623

Word expansion for interfaces. Just needed accept non-ranges as values. Also added graceful handling to ranges with more than a single character (currently throws an ord error because it has more than one character in a range's beginning or end).

I could not, for the life of me, think of a better example of word expansion than [xe,ge]-0/0/0. I'm open for suggestions.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/3865 **Author:** [@hSaria](https://github.com/hSaria) **Created:** 1/8/2020 **Status:** ✅ Merged **Merged:** 1/10/2020 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `3623-interface-word-expansion` --- ### 📝 Commits (9) - [`eb40275`](https://github.com/netbox-community/netbox/commit/eb40275427047b1007b9a73d14c5d087ac6a7021) Fixes #3623: Word expansion for interfaces - [`396bb28`](https://github.com/netbox-community/netbox/commit/396bb28967b040247eea67c92ab7ea47a67a9c62) Added example and handled invalid ranges gracefully - [`094553d`](https://github.com/netbox-community/netbox/commit/094553dbe7cd27931ab7e9d7b1ac85ea8e215c6a) Merge branch 'develop' into 3623-interface-word-expansion - [`c13b9d8`](https://github.com/netbox-community/netbox/commit/c13b9d87983a1fc7b3e1434e219bb85545f90513) Added tests for IPv4 - [`fe89982`](https://github.com/netbox-community/netbox/commit/fe89982d4ef663427d91e4efe67b364ccebaa811) Removed redundant list call - [`2eba84d`](https://github.com/netbox-community/netbox/commit/2eba84dad5e2c385ea3c3553f89ae09af7a31afd) Added tests for IPv6 - [`acb66c7`](https://github.com/netbox-community/netbox/commit/acb66c7dc0f99435299bfb81ec7d626dfd632714) Negative tests for expand_ipaddress_pattern - [`71120d9`](https://github.com/netbox-community/netbox/commit/71120d9899d4f6481a07b9728c10ba3dbc0aa0bd) Added tests for alphanumeric - [`a5413a5`](https://github.com/netbox-community/netbox/commit/a5413a54845a9c40ee5e2220e406db105a6e2f0e) Merge branch 'develop' into 3623-interface-word-expansion ### 📊 Changes **3 files changed** (+295 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `docs/release-notes/version-2.6.md` (+1 -0) 📝 `netbox/utilities/forms.py` (+11 -2) ➕ `netbox/utilities/tests/test_forms.py` (+283 -0) </details> ### 📄 Description ### Fixes: #3623 Word expansion for interfaces. Just needed accept non-ranges as values. Also added graceful handling to ranges with more than a single character (currently throws an `ord` error because it has more than one character in a range's beginning or end). > I could not, for the life of me, think of a better example of word expansion than `[xe,ge]-0/0/0`. I'm open for suggestions. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 22:22:57 +01:00
adam closed this issue 2025-12-29 22:22:57 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#12670