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
[DON'T MERGE] - Add VRF structure in for get_interfaces_ip #819
Conversation
Replaces #815 |
Related to: |
Items that are needed (at least longer term):
|
@FloLaco Can you provide more details on what the issue with napalm validate is? |
The issue is how to provide the vrf argument in the validation file ? |
I think you should be able to do:
We will need to verify this though. |
@bewing Any chance of reviewing this? Thanks. |
@ktbyers I tried to add kwargs in 2 places but it does not work.
or
I also tried |
Put on hold as we are probably going to solve this slightly differently. |
@FloLaco It should be _kwargs. Why are you making it a list?
I think it should be:
|
@FloLaco I am pretty much going from this example (and I had checked the source code last week for a different issue). See the 'ping' example. https://napalm.readthedocs.io/en/latest/validate/ Yes, in your validation file. Here is the relevant area of the source code: https://github.com/napalm-automation/napalm/blob/develop/napalm/base/validate.py#L192 Note, this would be a separate issue so if there is a problem here you should open a separate issue on it. |
@ktbyers Thanks for the links. Ok so it should work like you said. I'll try again tomorrow and will open a new issue if it's still not working. |
Yes, sounds good. I haven't tested it so if there is an issue there...just let us know. |
@ktbyers I've tested and it works.. noob error, I've edited the wrong validation_file ... |
Related to PR napalm-automation#819 and issue napalm-automation#792
For nxos_ssh the below patch should work. --- a/napalm/nxos_ssh/nxos_ssh.py
+++ b/napalm/nxos_ssh/nxos_ssh.py
@@ -889,7 +889,7 @@ class NXOSSSHDriver(NXOSDriverBase):
output = self._send_command(command) # noqa
return ntp_stats
- def get_interfaces_ip(self):
+ def get_interfaces_ip(self, vrf=""):
"""
Get interface IP details. Returns a dictionary of dictionaries.
@@ -920,8 +920,8 @@ class NXOSSSHDriver(NXOSDriverBase):
}
"""
interfaces_ip = {}
- ipv4_command = 'show ip interface vrf default'
- ipv6_command = 'show ipv6 interface vrf default'
+ ipv4_command = 'show ip interface vrf {}'.format(vrf or "default")
+ ipv6_command = 'show ipv6 interface vrf {}'.format(vrf or "default")
output_v4 = self._send_command(ipv4_command)
output_v6 = self._send_command(ipv6_command)
|
I've implemented the above patch in PR #877 |
From base.py:
I would vote to turn this around and make the default to show from all VRFs. E.g.
|
@jobec Let me review the past history on this issue a bit. On the face of it that all sounds reasonable as my main concern regarding using 'all' related to backwards compatibility. |
Related to PR napalm-automation#819 and issue napalm-automation#792
Bypass for an issue that eventually will be fixed in these PRs napalm-automation#877, napalm-automation#874, napalm-automation#819, napalm-automation#722
This is not being actively worked on any longer so I am going to close it. |
Add VRF structure for get_interfaces_ip