Closed Orobas-D closed 4 years ago
CloudEngine-Ansible-master\plugins\terminal\ce.py
class TerminalModule(TerminalBase): terminal_stdout_re = [ re.compile(r'[\r\n]?<.+>(?:\s*)$'), #请问\r\n怎么匹配的? re.compile(r'[\r\n]?\[.+\](?:\s*)$'), ] terminal_stderr_re = [ re.compile(r"% ?Error: "), re.compile(r"^% \w+", re.M), re.compile(r"% ?Bad secret"), re.compile(r"invalid input", re.I), re.compile(r"(?:incomplete|ambiguous) command", re.I), re.compile(r"connection timed out", re.I), re.compile(r"[^\r\n]+ not found", re.I), re.compile(r"'[^']' +returned error code: ?\d+"), re.compile(r"syntax error"), re.compile(r"unknown command"), re.compile(r"Error\[\d+\]: ", re.I), re.compile(r"Error:", re.I) ] def on_open_shell(self): try: self._exec_cli_command('screen-length 0 temporary') except AnsibleConnectionFailure: raise AnsibleConnectionFailure('unable to set terminal parameters')
我理解的正确表达式不应该是这样的吗?
r'[\r][\n]?<.+>(?:\s*)$'
交换机返回的应该是 ··· b'\r\n\<Huawei>' ··· 难道不是吗?
重新看了一下,没问题,我自己傻逼了
@Orobas-D 我的ansible ce模块维护人员,后面有问题随时沟通
CloudEngine-Ansible-master\plugins\terminal\ce.py
我理解的正确表达式不应该是这样的吗?
交换机返回的应该是 ··· b'\r\n\<Huawei>' ··· 难道不是吗?