Leading and trailing spaces ignored when renaming multiple interfaces #4437

Closed
opened 2025-12-29 18:35:57 +01:00 by adam · 4 comments
Owner

Originally created by @baprx on GitHub (Jan 5, 2021).

Environment

  • Python version: 3.6.9
  • NetBox version: v2.7.4

Steps to Reproduce

  1. On a device view, select multiple interfaces
  2. Click rename at the bottom of the page
  3. Try replacing the regex "$" with the string " test"

Expected Behavior

The text "example" should have been replaced by "example test"

Observed Behavior

The text is replace by "exampletest", ignoring any leading and trailing spaces.

Example:
Sans titre

Originally created by @baprx on GitHub (Jan 5, 2021). <!-- NOTE: IF YOUR ISSUE DOES NOT FOLLOW THIS TEMPLATE, IT WILL BE CLOSED. This form is only for reporting reproducible bugs. If you need assistance with NetBox installation, or if you have a general question, please start a discussion instead: https://github.com/netbox-community/netbox/discussions Please describe the environment in which you are running NetBox. Be sure that you are running an unmodified instance of the latest stable release before submitting a bug report, and that any plugins have been disabled. --> ### Environment * Python version: 3.6.9 * NetBox version: v2.7.4 <!-- Describe in detail the exact steps that someone else can take to reproduce this bug using the current stable release of NetBox. Begin with the creation of any necessary database objects and call out every operation being performed explicitly. If reporting a bug in the REST API, be sure to reconstruct the raw HTTP request(s) being made: Don't rely on a client library such as pynetbox. --> ### Steps to Reproduce 1. On a device view, select multiple interfaces 2. Click rename at the bottom of the page 3. Try replacing the regex "$" with the string " test" <!-- What did you expect to happen? --> ### Expected Behavior The text "example" should have been replaced by "example test" <!-- What happened instead? --> ### Observed Behavior The text is replace by "exampletest", ignoring any leading and trailing spaces. Example: ![Sans titre](https://user-images.githubusercontent.com/32563450/103631746-aab00e80-4f43-11eb-9a17-8ac3af25f508.png)
adam added the pending closure label 2025-12-29 18:35:57 +01:00
adam closed this issue 2025-12-29 18:35:58 +01:00
Author
Owner

@DanSheps commented on GitHub (Jan 5, 2021):

I have confirmed the behaviour, the BulkRenameForm field needs strip=False.

However, I don't know that we want this behaviour of not stripping.

@DanSheps commented on GitHub (Jan 5, 2021): I have confirmed the behaviour, the BulkRenameForm field needs strip=False. However, I don't know that we want this behaviour of not stripping.
Author
Owner

@DanSheps commented on GitHub (Jan 5, 2021):

After some discussion, this was done intentionally to prevent extraneous whitespace.

@DanSheps commented on GitHub (Jan 5, 2021): After some discussion, this was done intentionally to prevent extraneous whitespace.
Author
Owner

@baprx commented on GitHub (Jan 5, 2021):

I didn't know about this parameter, thank you.

@baprx commented on GitHub (Jan 5, 2021): I didn't know about this parameter, thank you.
Author
Owner

@DanSheps commented on GitHub (Jan 5, 2021):

@BapRx Keep in mind any changes you make to the code will be on you to maintain, and we will not be supporting it.

@DanSheps commented on GitHub (Jan 5, 2021): @BapRx Keep in mind any changes you make to the code will be on you to maintain, and we will not be supporting it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4437