Interface list issue #610

Closed
opened 2025-12-29 16:23:50 +01:00 by adam · 6 comments
Owner

Originally created by @tomasaberg on GitHub (Jan 5, 2017).

Hi!

I'm trying to add a Cisco ASR1000 device with six SFP Gigabit Interfaces, added like so: GigabitEthernet0/0/[0-5]

This device also have two TenGigabyteEthernet interfaces. When I try to add them as TenGigabitEthernet0/0/[0-1] the TenGigabitEthernet interfaces aren't listed, only the GigabitEthernet interfaces. However, if i remove the GigabitEthernet0/0/0 and GigabitEthernet0/0/1, they'll show up.

To reproduce:

  1. Create a device
  2. Add interface GigabitEthernet0/0/[0-5]
  3. Add interface TenGigabitEthernet0/0/[0-1]
  4. Look at the list

Netbox version: v1.8.0

Interfaces in ASR1000

interface TenGigabitEthernet0/0/0
interface TenGigabitEthernet0/0/1
interface GigabitEthernet0/0/0
interface GigabitEthernet0/0/1
interface GigabitEthernet0/0/2
interface GigabitEthernet0/0/3
interface GigabitEthernet0/0/4
interface GigabitEthernet0/0/5

Since I'm new to Netbox, I wonder if I'm doing something wrong or if this is a bug

Originally created by @tomasaberg on GitHub (Jan 5, 2017). Hi! I'm trying to add a Cisco ASR1000 device with six SFP Gigabit Interfaces, added like so: `GigabitEthernet0/0/[0-5]` This device also have two TenGigabyteEthernet interfaces. When I try to add them as `TenGigabitEthernet0/0/[0-1]` the TenGigabitEthernet interfaces aren't listed, only the GigabitEthernet interfaces. However, if i remove the GigabitEthernet0/0/0 and GigabitEthernet0/0/1, they'll show up. To reproduce: 1. Create a device 2. Add interface GigabitEthernet0/0/[0-5] 3. Add interface TenGigabitEthernet0/0/[0-1] 4. Look at the list Netbox version: v1.8.0 Interfaces in ASR1000 > interface TenGigabitEthernet0/0/0 > interface TenGigabitEthernet0/0/1 > interface GigabitEthernet0/0/0 > interface GigabitEthernet0/0/1 > interface GigabitEthernet0/0/2 > interface GigabitEthernet0/0/3 > interface GigabitEthernet0/0/4 > interface GigabitEthernet0/0/5 Since I'm new to Netbox, I wonder if I'm doing something wrong or if this is a bug
adam added the type: bug label 2025-12-29 16:23:50 +01:00
adam closed this issue 2025-12-29 16:23:50 +01:00
Author
Owner

@tomasaberg commented on GitHub (Jan 5, 2017):

Using shortnames works, but the sorting is a bit off.
te0/0/0 SFP+ (10GE)
gi0/0/0 SFP (1GE)
te0/0/1 SFP+ (10GE)
gi0/0/1 SFP (1GE)
gi0/0/2 SFP (1GE)
gi0/0/3 SFP (1GE)
gi0/0/4 SFP (1GE)
gi0/0/5 SFP (1GE)

@tomasaberg commented on GitHub (Jan 5, 2017): Using shortnames works, but the sorting is a bit off. te0/0/0 SFP+ (10GE) gi0/0/0 SFP (1GE) te0/0/1 SFP+ (10GE) gi0/0/1 SFP (1GE) gi0/0/2 SFP (1GE) gi0/0/3 SFP (1GE) gi0/0/4 SFP (1GE) gi0/0/5 SFP (1GE)
Author
Owner

@jeremystretch commented on GitHub (Jan 5, 2017):

I'm not able to replicate this on v1.8.1. I created the seven interfaces using the two ranges you specified:

screenshot

The ordering is a separate issue that will be addressed in #284. Currently, interfaces are ordered by their slot and position IDs, rather than by name. This results in unnatural ordering for some platforms.

@jeremystretch commented on GitHub (Jan 5, 2017): I'm not able to replicate this on v1.8.1. I created the seven interfaces using the two ranges you specified: ![screenshot](https://cloud.githubusercontent.com/assets/13487278/21691341/2b8c7a3a-d346-11e6-89aa-1f8c5e4d84d4.png) The ordering is a separate issue that will be addressed in #284. Currently, interfaces are ordered by their slot and position IDs, rather than by name. This results in unnatural ordering for some platforms.
Author
Owner

@jeremystretch commented on GitHub (Jan 5, 2017):

My mistake, I was trying this on an instantiated device. The issue you're seeing is assigning interface templates to a device type. Let me poke at it some more.

@jeremystretch commented on GitHub (Jan 5, 2017): My mistake, I was trying this on an instantiated device. The issue you're seeing is assigning interface templates to a device type. Let me poke at it some more.
Author
Owner

@jeremystretch commented on GitHub (Jan 5, 2017):

It looks like django-tables2 is doing something funny with the queryset. I can dump the list of InterfaceTemplate objects from the view and everything looks normal, but the table is doing something strange to our custom-ordered queryset. Interestingly, the table renders perfectly fine if I cast the queryset to a list before feeding it to the table.

At the risk of appearing cowardly, I think it makes sense to forego tables for DeviceType components altogether anyway, as we do for Device components (each components table is an included template).

@jeremystretch commented on GitHub (Jan 5, 2017): It looks like django-tables2 is doing something funny with the queryset. I can dump the list of InterfaceTemplate objects from the view and everything looks normal, but the table is doing something strange to our custom-ordered queryset. Interestingly, the table renders perfectly fine if I cast the queryset to a list before feeding it to the table. At the risk of appearing cowardly, I think it makes sense to forego tables for DeviceType components altogether anyway, as we do for Device components (each components table is an included template).
Author
Owner

@jeremystretch commented on GitHub (Jan 5, 2017):

Turns out this was easy enough to fix by explicitly sorting on the name field after the slot/position tuple to handle duplicates.

@jeremystretch commented on GitHub (Jan 5, 2017): Turns out this was easy enough to fix by explicitly sorting on the `name` field after the slot/position tuple to handle duplicates.
Author
Owner

@tomasaberg commented on GitHub (Jan 5, 2017):

Wow, impressive response.
Thank you!

@tomasaberg commented on GitHub (Jan 5, 2017): Wow, impressive response. Thank you!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#610