-
Notifications
You must be signed in to change notification settings - Fork 7
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
Implement get_interfaces_ip #24
Implement get_interfaces_ip #24
Conversation
Looks like there's a linting error -- can you |
71b99d4
to
94ba753
Compare
Whoops, now linted |
Thank you for this additional feature! However, you've highlighted what are probably some poor decisions I've made in the past regarding interface key naming. Currently, Ideally, we'd have the same key refer to the same interface across all the functions. The NX-OS/IOS drivers uses In [1]: from napalm.base.helpers import abbreviated_interface_name,
...: canonical_interface_name
In [2]: canonical_interface_name("Ma1")
Out[2]: 'Management1'
In [3]: canonical_interface_name("et1")
Out[3]: 'Ethernet1'
In [4]: canonical_interface_name("ma1")
Out[4]: 'ma1'
In [5]: abbreviated_interface_name("Management1")
Out[5]: 'Ma1'
In [6]: abbreviated_interface_name("Ethernet1")
Out[6]: 'Et1' Note that At minimum, |
I agree on both counts: If you want to avoid breaking back-compat right now; I see two options:
I think lower-casing is reasonable; I have a variety of devices: OS Version
Model:
and they all return lower-case interfaces. Otherwise, break compatibility to ensure these two functions will always return compatible keys |
Sorry for the delay on this. Reviewed with some other users as well, and the consensus is to go with all lowercase keys for now, and if/when we do a major version upgrade in napalm_mos, switch to canonical. This may/may not happen at all given the move towards EOS with the newer devices. Can you update your changeset to reflect? |
Signed-off-by: DavidVentura <[email protected]>
94ba753
to
191642d
Compare
Thank you for contributing! |
This implements #23 ;
get_interfaces_ip
Signed-off-by: DavidVentura [email protected]