Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interface list issue #778

Closed
tomasaberg opened this issue Jan 5, 2017 · 6 comments
Closed

Interface list issue #778

tomasaberg opened this issue Jan 5, 2017 · 6 comments
Labels
type: bug A confirmed report of unexpected behavior in the application

Comments

@tomasaberg
Copy link

tomasaberg commented 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

@tomasaberg
Copy link
Author

tomasaberg commented 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)

@jeremystretch
Copy link
Member

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
Copy link
Member

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 jeremystretch added the type: bug A confirmed report of unexpected behavior in the application label Jan 5, 2017
@jeremystretch
Copy link
Member

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
Copy link
Member

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

@tomasaberg
Copy link
Author

Wow, impressive response.
Thank you!

lampwins pushed a commit to lampwins/netbox that referenced this issue Oct 13, 2017
@lock lock bot locked as resolved and limited conversation to collaborators Jan 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

2 participants