mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-26 08:26:28 +00:00
Port shell snippet to python3/2.4 compatible syntax (#15874)
This commit is contained in:
committed by
Brian Coca
parent
127a37f67c
commit
97f16b7700
@@ -31,6 +31,7 @@ try:
|
||||
except ImportError:
|
||||
HAS_PARAMIKO = False
|
||||
|
||||
from ansible.module_utils.basic import get_exception
|
||||
|
||||
ANSI_RE = re.compile(r'(\x1b\[\?1h\x1b=)')
|
||||
|
||||
@@ -135,7 +136,8 @@ class Shell(object):
|
||||
if self.read(window):
|
||||
resp = self.strip(recv.getvalue())
|
||||
return self.sanitize(cmd, resp)
|
||||
except ShellError, exc:
|
||||
except ShellError:
|
||||
exc = get_exception()
|
||||
exc.command = cmd
|
||||
raise
|
||||
|
||||
|
||||
Reference in New Issue
Block a user