>From Ansible version 2.9 onwards you can configure a list of terminal regex
(ansible_terminal_stderr_re and ansible_terminal_stdout_re) to identify if
the response is an error or valid output.
Refer:
https://docs.ansible.com/ansible/devel/network/user_guide/network_debug_troubleshooting.html#task-failure-due-to-mismatched-error-regex-within-command-response-using-network-cli-connection-type

On Fri, Apr 10, 2020 at 1:41 PM Yann <yann.vercuc...@gmail.com> wrote:

> Hi,
>
> In my team we are using several custom modules based on network_cli /
> cliconf.
>
> For one of our manufacturer, we have a issue with the method
> "_find_prompt" of the "network_cli.py", we would like to know if its
> possible to overload "network_cli.py" and how ?
>
> For now, we put a modified "network_cli.py" on the module folder called
> "connection_plugins", but we would like to only overload the method
> "_find_prompt".
>
>
> About the issue that we face :
> In a custom module, you have to set, in the terminal_plugins, some info
> about the "stderr" and "stdout".
> For example :
> stderr = "command unknown"
> stdout = "MyPrompt >"
>
> When stderr match, an error should be raise.
> And the data are catched until the "stdout" match.
>
> When you have a chunk of data like : ["Command unknown", "MyPrompt >"]
> => No problem, an error is raise
>
> BUT, when you have several chunk of data like :
> 1st chunk : ["Command unknown", "Lorem", "ipsum"]
> 2st chunk : ["Lorem2", "MyPrompt >"]
>
> In this case no error is raise !
>
> So I have two questions :)
>
> * How to deal with this kind of behaviour ?
> * How to overload a specific function in "network_cli.py" ?
>
>
> Thanks :)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-devel+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-devel/c33895c4-b69e-4336-a795-e59cbe496dd3%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-devel/c33895c4-b69e-4336-a795-e59cbe496dd3%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Regards,
Ganesh B. Nalawade

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CA%2B6y2sFBSwQPncZQqUbgK_psQFCsrvWywezuPou7Zov1n9-%3DvQ%40mail.gmail.com.

Reply via email to