napalm-automation-community / napalm-ftos

NAPALM Driver for Dell/Force10 FTOS
Apache License 2.0
9 stars 7 forks source link

Bug in get_lldp_neighbors #8

Open pomac303 opened 2 years ago

pomac303 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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...