Inconsistent Interface ordering after #4336 fix #3970

Closed
opened 2025-12-29 18:32:22 +01:00 by adam · 2 comments
Owner

Originally created by @JulianJacobi on GitHub (Aug 12, 2020).

Environment

  • Python version: 3.7
  • NetBox version: 2.8.6

Steps to Reproduce

  1. Start with Netbox Version <= 2.7.9
  2. Create device Foo with interfaces [Po1, Po1.155, Po1.156]
  3. Update Netbox to version 2.8.6
  4. Add Interface Po.2522 to device Foo

Expected Behavior

Interface ordering is:

  • Po1
  • Po1.155
  • Po1.156
  • Po1.2522

Observed Behavior

Interface ordering is:

  • Po1.2522
  • Po1
  • Po1.155
  • Po1.156

Additional Thoughts

After a little bit of research I found #4336 and see that the fix changes the way the interface._name field is calculated for ordering. After looking into my database I there was the "old" interfaces has _name created with the "old" style and the new interface has _name created with the new style:

name _name
Po1 9999999999999999Po000001000000000000
Po1.155 9999999999999999Po000001000000000155
Po1.156 9999999999999999Po000001000000000156
Po1.2522 9999999999999999Po000001......002522
Originally created by @JulianJacobi on GitHub (Aug 12, 2020). <!-- NOTE: IF YOUR ISSUE DOES NOT FOLLOW THIS TEMPLATE, IT WILL BE CLOSED. This form is only for reproducible bugs. If you need assistance with NetBox installation, or if you have a general question, DO NOT open an issue. Instead, post to our mailing list: https://groups.google.com/forum/#!forum/netbox-discuss 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.7 * NetBox version: 2.8.6 <!-- 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. Start with Netbox Version <= 2.7.9 2. Create device Foo with interfaces [`Po1`, `Po1.155`, `Po1.156`] 3. Update Netbox to version 2.8.6 4. Add Interface `Po.2522` to device Foo <!-- What did you expect to happen? --> ### Expected Behavior Interface ordering is: * `Po1` * `Po1.155` * `Po1.156` * `Po1.2522` <!-- What happened instead? --> ### Observed Behavior Interface ordering is: * `Po1.2522` * `Po1` * `Po1.155` * `Po1.156` ### Additional Thoughts After a little bit of research I found #4336 and see that the fix changes the way the `interface._name` field is calculated for ordering. After looking into my database I there was the "old" interfaces has `_name` created with the "old" style and the new interface has `_name` created with the new style: name | _name --- | --- `Po1` | `9999999999999999Po000001000000000000` `Po1.155` | `9999999999999999Po000001000000000155` `Po1.156` | `9999999999999999Po000001000000000156` `Po1.2522` | `9999999999999999Po000001......002522`
adam closed this issue 2025-12-29 18:32:22 +01:00
Author
Owner

@jeremystretch commented on GitHub (Aug 14, 2020):

We may have neglected to include a migration to update the names as part of that fix. Does running manage.py renaturalize dcim.Interface fix this?

@jeremystretch commented on GitHub (Aug 14, 2020): We may have neglected to include a migration to update the names as part of that fix. Does running `manage.py renaturalize dcim.Interface` fix this?
Author
Owner

@JulianJacobi commented on GitHub (Aug 14, 2020):

Does running manage.py renaturalize dcim.Interface fix this?

Yes, everything is fine now.

Thanks for the help.

@JulianJacobi commented on GitHub (Aug 14, 2020): >Does running manage.py renaturalize dcim.Interface fix this? Yes, everything is fine now. Thanks for the help.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3970