Port shell snippet to python3/2.4 compatible syntax (#15874)
This commit is contained in:
parent
127a37f67c
commit
97f16b7700
1 changed files with 3 additions and 1 deletions
|
@ -31,6 +31,7 @@ try:
|
||||||
except ImportError:
|
except ImportError:
|
||||||
HAS_PARAMIKO = False
|
HAS_PARAMIKO = False
|
||||||
|
|
||||||
|
from ansible.module_utils.basic import get_exception
|
||||||
|
|
||||||
ANSI_RE = re.compile(r'(\x1b\[\?1h\x1b=)')
|
ANSI_RE = re.compile(r'(\x1b\[\?1h\x1b=)')
|
||||||
|
|
||||||
|
@ -135,7 +136,8 @@ class Shell(object):
|
||||||
if self.read(window):
|
if self.read(window):
|
||||||
resp = self.strip(recv.getvalue())
|
resp = self.strip(recv.getvalue())
|
||||||
return self.sanitize(cmd, resp)
|
return self.sanitize(cmd, resp)
|
||||||
except ShellError, exc:
|
except ShellError:
|
||||||
|
exc = get_exception()
|
||||||
exc.command = cmd
|
exc.command = cmd
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue