Open dkaplan1 opened 1 month ago
Hi @dkaplan1 Thanks for the pull request. Please find the review comments.
we are seeing one warning for following line of code. if rsp.tag in "output" and rsp.getparent():
can be changed to if rsp.tag in "output" and rsp.getparent() is not None:
Please check if it can be fixed, otherwise the cli response has the full response.
/root/pyez_release_272/venv/lib/python3.12/site-packages/junos_eznc-2.7.1+9.ga64698b2-py3.12.egg/jnpr/junos/device.py:738: FutureWarning: The behavior of this method will change in future versions. Use specific 'len(elem)' or 'elem is not None' test instead.
if rsp.tag in "output" and rsp.getparent():
/var/crash/*core*: No such file or directory
/var/tmp/*core*: No such file or directory
/var/tmp/pics/*core*: No such file or directory
/var/crash/kernel.*: No such file or directory
/var/jails/rest-api/tmp/*core*: No such file or directory
/tftpboot/corefiles/*core*: No such file or directory
python cli_test.py
Temp CPU Utilization (%) CPU Utilization (%) Memory Utilization (%)
Slot State (C) Total Interrupt 1min 5min 15min DRAM (MB) Heap Buffer
0 Online Testing 4 0 3 3 3 511 34 0
1 Empty
2 Empty
3 Empty
4 Empty
5 Empty
6 Empty
7 Empty
8 Empty
9 Empty
10 Empty
11 Empty
python cli_test.py
/root/pyez_release_272/venv/lib/python3.12/site-packages/paramiko/pkey.py:100: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from this module in 48.0.0.
"cipher": algorithms.TripleDES,
/root/pyez_release_272/venv/lib/python3.12/site-packages/paramiko/transport.py:271: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from this module in 48.0.0.
"class": algorithms.TripleDES,
/var/crash/*core*: No such file or directory
/var/tmp/*core*: No such file or directory
/var/tmp/pics/*core*: No such file or directory
/var/crash/kernel.*: No such file or directory
/var/jails/rest-api/tmp/*core*: No such file or directory
/tftpboot/corefiles/*core*: No such file or directory
Thanks Chidanand
Thanks for the review @chidanandpujar, updated.
Hi @dkaplan1 Thanks for taking care of review comments. Fix looks to be working fine .
python cli_test.py
/root/pyez_release_272/venv/lib/python3.12/site-packages/paramiko/pkey.py:100: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from this module in 48.0.0.
"cipher": algorithms.TripleDES,
/root/pyez_release_272/venv/lib/python3.12/site-packages/paramiko/transport.py:271: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from this module in 48.0.0.
"class": algorithms.TripleDES,
/var/crash/*core*: No such file or directory
/var/tmp/*core*: No such file or directory
/var/tmp/pics/*core*: No such file or directory
/var/crash/kernel.*: No such file or directory
/var/jails/rest-api/tmp/*core*: No such file or directory
/tftpboot/corefiles/*core*: No such file or directory
Temp CPU Utilization (%) CPU Utilization (%) Memory Utilization (%)
Slot State (C) Total Interrupt 1min 5min 15min DRAM (MB) Heap Buffer
0 Online Testing 3 0 3 3 3 511 34 0
1 Empty
2 Empty
3 Empty
4 Empty
5 Empty
6 Empty
7 Empty
8 Empty
9 Empty
10 Empty
11 Empty
Thanks Chidanand
junos-eznc
'sexecute
function only returns the first child element, described in https://github.com/Juniper/py-junos-eznc/blob/a64698b280fb717730dddf75a2d4d8cacb2e4775/lib/jnpr/junos/device.py#L896-L901 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.