-
Notifications
You must be signed in to change notification settings - Fork 557
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
EOS: Add a JSON option when running a cli command #1637
EOS: Add a JSON option when running a cli command #1637
Conversation
pyeapi supports JSON as an option for the cli commands. However right now the JSON option isn't exposed to users of this API. This exposes the JSON option as well.
pyeapi supports JSON as an option for the cli commands. However right now the JSON option isn't exposed to users of this API. This exposes the JSON option as well.
Tests are failing on this change. |
I was noticing that. I'm wondering the best way to handle adding functionality would be. It looks like tests are failing because I've added an extra argument to this function that it's not expecting. Would it ok to modify the test to allow the extra args in the EOS case? |
So the test issue is that all of the NAPALM drivers (junos, eos, ios, etc) must have the same signature for the method:
So if we add the You can always access pyeapi via napalm using:
I guess I wonder if we really need to be able to execute the |
Ok. that seems reasonable. I was unaware that the "device" attribute was considered a stable part of the api. I have proposed this solution for the customer trying to use this to confirm if this works for them or not. |
Yeah, I would think we would It is possible this |
@dasturiasArista Yeah, let us know what you find and if that solution works. |
Yes will do! Not to keep you hanging, still waiting from the response from the customer. |
Just to add to Kirk's comment further:
We have a similar request for Junos (#1500) so it'd be great if you could go ahead with this and I can take care of the Junos implementation. |
Ok. I can go ahead and add the argument to all of the drivers, but for those that don't support that encoding i'll just have it raise an error. How do you feel about raising a |
pyeapi supports JSON as an option for the cli commands. However right now the JSON option isn't exposed to users of this API. This exposes the JSON option as well.
…into napalm-automation-develop
Btw I have proactively made the changes we talked about here. Also, each method will check that it's valid and throw a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, just requesting to raise NotImplementedError
instead of ValueError
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @dasturiasArista!
pyeapi supports JSON as an option for the cli commands. However right
now the JSON option isn't exposed to users of this API. This exposes the
JSON option as well.
I manually tested this with an Arista switch and verified the changes work.