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

Bug in get_lldp_neighbors #8

Open
pomac303 opened this issue Oct 25, 2021 · 2 comments
Open

Bug in get_lldp_neighbors #8

pomac303 opened this issue Oct 25, 2021 · 2 comments

Comments

@pomac303
Copy link

So, mac() will throw an exception if the value is not a known mac address.

Example:
2021-10-25 10:54:55,820 - napalm - ERROR - method - Failed: failed to detect EUI version: 'ethernet1/1/1:1'

Quick and dirty fix is:
# cast some mac addresses
for k in ['remote_port', 'remote_chassis_id']:
if len(lldp_entry[k].strip()) > 0:
try:
lldp_entry[k] = mac(lldp_entry[k])
finally:
continue

Around line 322 in ftos.py

@skoef
Copy link
Collaborator

skoef commented Oct 25, 2021

Hi @pomac303, thanks for filing this issue! Could you send in a PR and testcase confirming this fix works? I don't have an environment to test your change atm. Thanks in advance!

@pomac303
Copy link
Author

Running with pprint.pprint(lldp_... gives:
{'remote_chassis_id': '18:5a:58:02:05:80',
'remote_port': 'ethernet1/1/1:1',

so remote_port would not be a EUI ;)

I suspect that it used to silently ignore things like this, or it's special for 4810:s either way, this was a quick hack since i don't actually have the time to devote to it :/ perhaps there is some kind of check or better function that could be used instead...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants