1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Port shell snippet to python3/2.4 compatible syntax (#15874)

This commit is contained in:
Michael Scherer 2016-05-16 14:10:07 +02:00 committed by Brian Coca
parent 127a37f67c
commit 97f16b7700

View file

@ -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