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

Disable "Virtual Interface" types from displaying in "LLDP Neighbors" tab of device #1420

Closed
bdlamprecht opened this issue Aug 11, 2017 · 2 comments
Labels
type: bug A confirmed report of unexpected behavior in the application

Comments

@bdlamprecht
Copy link
Contributor

Issue type:

Bug

NetBox version:
2.1.2

With the recent integration of NAPALM, LLDP information is displayed on the "LLDP Neighbors" tab of a device. Currently all interfaces are displayed on the that tab (including "Virtual" interfaces that will never have a neighbor.

This request is to exclude those all "virtual" and "lag" interfaces from being displayed on that tab.

@jeremystretch jeremystretch added the type: bug A confirmed report of unexpected behavior in the application label Aug 14, 2017
@jeremystretch
Copy link
Member

Calling this a bug since the current behavior doesn't really make sense.

@huzichunjohn
Copy link
Contributor

--- a/netbox/dcim/views.py
+++ b/netbox/dcim/views.py
@@ -32,6 +32,7 @@ from .models import (
     Manufacturer, InventoryItem, Platform, PowerOutlet, PowerOutletTemplate, PowerPort, PowerPortTemplate, Rack,
     RackGroup, RackReservation, RackRole, Region, Site,
 )
+from .constants import *
 
 
 EXPANSION_PATTERN = '\[(\d+-\d+)\]'
@@ -937,8 +938,10 @@ class DeviceLLDPNeighborsView(PermissionRequiredMixin, View):
         interfaces = Interface.objects.order_naturally(
             device.device_type.interface_ordering
         ).filter(
-            device=device
-        ).select_related(
+            device=device,
+       ).exclude(
+           form_factor__in=VIRTUAL_IFACE_TYPES
+       ).select_related(
             'connected_as_a', 'connected_as_b'
         )

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 18, 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

3 participants