Closed sincerywaing closed 7 years ago
Hi @sincerywaing:
for some command it won't execute as expected, like ping or trace
Unfortunately, there's nothing we can do about that -- some commands are forbidden from CLI execution. This is intentional: naturally and understandably, Juniper wants to discourage users from doing this.
I would suggest you write a private method in your environment that does what you need.
Just out of curiosity: is there any information you'd need from cli('show bgp summary')
that's not provided by the existing get_bgp_neighbors
or get_bgp_neighbors_detail
?
for some command we get warning which mess up the output
Apparently, there's a way to prevent this: https://github.com/Juniper/py-junos-eznc/blob/master/lib/jnpr/junos/device.py#L606 the cli
method has a flag called warning
which can be turned off when executing. I believe we can just turn it off by default, as the other platforms don't throw any warning when executing raw CLI commands. Eventually we can have another optional flag (defaulting to False
) to raise this warning when executing CLI commands, but I see no gain by doing this.
Any thoughts on this @dbarrosop?
@mirceaulinic make much sense. I'm just exploring a way to let user run some show command after they merge the config so they can do some check. Do you want me to file a pr to turn it off? I think again feel that optional_arg cli_warning might not needed. I'd file a pr to turn it off. Let me know if you agree so.
Solved in #186
Description of Issue/Question
if we want to use dev.cli(cmd) and get the output, it seems: 1) for some command it won't execute as expected, like ping or trace 2) for some command we get warning which mess up the output
To provide user more flexibility, I want to provide a way for user to enter show/ping/trace command he/she want to use in an interaction way.
anyway we can tweak this?
Did you follow the steps from https://github.com/napalm-automation/napalm#faq
[* ] Yes [ ] No
Setup
run any command has certain output
napalm-junos version
(Paste verbatim output from
pip freeze | grep napalm-junos
between quotes below)JunOS version
(Paste verbatim output from
show version and haiku
between quotes below)Steps to Reproduce the Issue
Error Traceback
(Paste the complete traceback of the exception between quotes below)