-
Notifications
You must be signed in to change notification settings - Fork 344
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
Get full RPC response in cli function #1315
Conversation
Hi @dkaplan1 we are seeing one warning for following line of code. can be changed to Please check if it can be fixed, otherwise the cli response has the full response.
Thanks |
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.
Please check if we can change the following line from
if rsp.tag == "output" and rsp.getparent():
to
if rsp.tag in "output" and rsp.getparent() is not None:
Thanks for the review @chidanandpujar, updated. |
Hi @dkaplan1
Thanks |
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
Validated functional tests: looks good. (venv) root@masterhost:~/pyez_release_test1/py-junos-eznc# nose2 -v -c nose2.cfg warnings.warn(warning_string, RuntimeWarning) ======================================================================
|
UT execution looks good. (venv) root@masterhost:~/pyez_release_test1/py-junos-eznc/tests/unit# nose2 -v ERROR:jnpr.junos.console: During handling of the above exception, another exception occurred: Traceback (most recent call last): ok ok ERROR:jnpr.junos.console: ok ERROR:jnpr.junos.console: ok ok ok ok Ran 826 tests in 10.092s OK |
ok to test |
Hi @dkaplan1, Thank you |
junos-eznc
'sexecute
function only returns the first child element, described inpy-junos-eznc/lib/jnpr/junos/device.py
Lines 896 to 901 in a64698b
Normally this isn't an issue, since commands return the full payload in one
<output>
as part of a<rpc-reply>
i.e.However, for some commands, like
show system core-dumps
, the<rpc-reply>
contains multiple<output>
s.In these cases, only selecting the first element means that we only select
and
cli
returns justinstead of the full output.
To fix this I'm proposing to get the parent of output message (if one exists) so that the full output of the command is returned.