mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 11:21:25 -07:00
Add sros changes for Python3 (#24604)
* Add sros changes for Python3 Make `execute_command` arguments and its return value complaint to PY3 changes made in PR #24431 Code cleanup pep8 fixes * Fix CI issue
This commit is contained in:
parent
16d610c1de
commit
a3c689bf0d
3 changed files with 18 additions and 38 deletions
|
@ -20,7 +20,6 @@ from __future__ import (absolute_import, division, print_function)
|
|||
__metaclass__ = type
|
||||
|
||||
import re
|
||||
import json
|
||||
|
||||
from ansible.plugins.terminal import TerminalBase
|
||||
from ansible.errors import AnsibleConnectionFailure
|
||||
|
@ -29,16 +28,16 @@ from ansible.errors import AnsibleConnectionFailure
|
|||
class TerminalModule(TerminalBase):
|
||||
|
||||
terminal_stdout_re = [
|
||||
re.compile(r"[\r\n]?[\w+\-\.:\/\[\]]+(?:\([^\)]+\)){,3}(?:>|#) ?$"),
|
||||
re.compile(r"\[\w+\@[\w\-\.]+(?: [^\]])\] ?[>#\$] ?$")
|
||||
re.compile(br"[\r\n]?[\w+\-\.:\/\[\]]+(?:\([^\)]+\)){,3}(?:>|#) ?$"),
|
||||
re.compile(br"\[\w+\@[\w\-\.]+(?: [^\]])\] ?[>#\$] ?$")
|
||||
]
|
||||
|
||||
terminal_stderr_re = [
|
||||
re.compile(r"Error:"),
|
||||
re.compile(br"Error:"),
|
||||
]
|
||||
|
||||
def on_open_shell(self):
|
||||
try:
|
||||
self._exec_cli_command('environment no more')
|
||||
self._exec_cli_command(b'environment no more')
|
||||
except AnsibleConnectionFailure:
|
||||
raise AnsibleConnectionFailure('unable to set terminal parameters')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue