Thx for the answer. But the problem is the same when it return several chunck of data :
1st chunk : ["Command unknown", "Lorem", "ipsum"] 2st chunk : ["Lorem2", "MyPrompt >"] In this case no error is raise, because between the 2 chunk, the variable : is_error_message is set to False In def receive([...]) [...] if self._find_prompt(window): def _find_prompt(self, response): '''Searches the buffered response for a matching command prompt ''' errored_response = None is_error_message = False Le vendredi 10 avril 2020 10:42:37 UTC+2, Ganesh Nalawade a écrit : > > > 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.v...@gmail.com <javascript:>> > 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 ansibl...@googlegroups.com <javascript:>. >> 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/a68fd781-de5c-454e-9fe2-7cc829c78c2c%40googlegroups.com.