Skip to content

Conversation

@scetron
Copy link
Contributor

@scetron scetron commented Dec 12, 2023

Added common network platforms supported by Aerleon and Capirca.

NETMIKO_LIB_MAPPER_REVERSE = copy.deepcopy(NETMIKO_LIB_MAPPER)
NTCTEMPLATES_LIB_MAPPER_REVERSE = copy.deepcopy(NTCTEMPLATES_LIB_MAPPER)

NETUTILS_LIBMAPPER_MAPPER = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this offer over "MAIN_LIB_MAPPER"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears to me that main lib mapper is more focused on the end platform, rather than the library that has a platform. I can't do MAIN_LIB_MAPPER['aerleon'] or MAIN_LIB_MAPPER['napalm'] unless I am mistaken?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any thoughts on this one?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, should it be "netmiko": list(NETMIKO_LIB_MAPPER.keys()), then?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking about it more, it should just be

from netutils import lib_mapper

getattr(lib_mapper, f"{lib.upper()}_LIB_MAPPER")

@itdependsnetworks
Copy link
Contributor

Can we just list all of them so they don't trickle in as much?

@scetron
Copy link
Contributor Author

scetron commented Dec 13, 2023

Do you mean list all of the platforms supported by Aerleon/Capirca? I didn't add them only because many of them don't have another name to be mapped to, which I am fine with adding as I see in some other mappers, it's the same.

@itdependsnetworks
Copy link
Contributor

Yea, would be good to know what those are, even if commented out for now.

@qduk
Copy link
Collaborator

qduk commented Dec 21, 2023

@scetron Can you add the new mappers to this dictionary. It should create the docs once you run the script.

@itdependsnetworks
Copy link
Contributor

@scetron let's remove the NETUTILS_LIBMAPPER_MAPPER and add to the dictionary, just to get capirca and aerleon in, we can take the topic of NETUTILS_LIBMAPPER_MAPPER to another issue.

@scetron
Copy link
Contributor Author

scetron commented Jan 4, 2024

@itdependsnetworks Sounds good. Removed. @qduk Added to dev scripts and generated the new docs.

Copy link
Collaborator

@qduk qduk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @scetron!

@itdependsnetworks itdependsnetworks merged commit 9f4d2df into networktocode:develop Jan 5, 2024
michalis1 pushed a commit to michalis1/netutils that referenced this pull request Feb 2, 2026
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.

Add mapper for supported libmappers Add Capirca and Aerleon to lib mapper

3 participants