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

Fix ios lldp discovery (rebase) #1849

Merged
merged 5 commits into from
Feb 16, 2023
Merged

Conversation

ktbyers
Copy link
Contributor

@ktbyers ktbyers commented Feb 16, 2023

No description provided.

@ktbyers
Copy link
Contributor Author

ktbyers commented Feb 16, 2023

FYI @CarloMara

@ktbyers
Copy link
Contributor Author

ktbyers commented Feb 16, 2023

@CarloMara Let me know if you see any issues:

FYI, I moved this port normalization to always happen:

                # If port is a mac-address, normalize it.
                # The MAC helper library will normalize "15" to "00:00:00:00:00:0F"
                if port.count(":") == 5 or port.count("-") == 5 or port.count(".") == 2:
                    try:
                        port = napalm.base.helpers.mac(port)
                    except AddrFormatError:
                        pass

I also had to put the conditional as some port identifiers like "15" would incorrectly try to get converted to MAC addresses.

I didn't see a good reason why the port MAC normalization should only happen in the if not hostname case.

Realistically, the NAPALM mac helper function should probably have more logic in it (to avoid incorrect MAC conversions) and my quick check shouldn't be needed.

@ktbyers ktbyers merged commit 9606c6e into develop Feb 16, 2023
@ktbyers ktbyers deleted the optiver-fix-ios-lldp-discovery4 branch February 28, 2024 18:26
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

Successfully merging this pull request may close these issues.

2 participants