napalm-automation-community / napalm-s350

NAPALM driver for Cisco SMB switches (SF3xx, SF5xx, SG3xx, SG5xx).
Apache License 2.0
16 stars 13 forks source link

lldp neighbors returns short interface names instead of full names #74

Closed nniehoff closed 3 years ago

nniehoff commented 3 years ago

Environment

Python version ('python3 --version'): 3.7.9

When I collect get_lldp_neighbors_detail() from the switch the dictionary is keyed off of the short interface names gi1 instead of gigabitethernet1. Based on the napalm documentation here I expected this to be keyed off of the full name gigabitethernet1 as shown in the output of show run. Inspecting the output of show lldp neighbors from the switch, I see the short name as well. This very well may just be a question if this is expected or not, maybe I'm the only one that expected the full names in which case I'll change my logic around a bit.

Steps to Reproduce

  1. Run get_lldp_neighbors_detail against an SG300 series switch
  2. Inspect the output

Expected Behavior

I expected to see the dictionary from get_lldp_neighbors_detail to be keyed off of the full names of the interfaces gigabitethernetX versus the short name of giX

Observed Behavior

The dictionary returned by get_lldp_neighbors_detail is keyed off of the short names of giX instead of gigabitethernetX.

qaxi commented 3 years ago

Yes, it is annoying as it complicates automation. It bug.

It should be solved everywhere by using:

For example: https://github.com/napalm-automation/napalm/blob/develop/napalm/ios/ios.py#L937

Will work on it.

qaxi commented 3 years ago

@nniehoff issu #74 should be solved in develop branch a bit question is "vlan" interfaces ... should be canonicalized too?