Also fix intermittent ssh error using pty's for paramiko

Related to #13876
This commit is contained in:
James Cammarata 2016-04-12 08:34:24 -04:00
parent 0ced20951f
commit 2e55b3567b

View file

@ -266,8 +266,8 @@ class Connection(ConnectionBase):
# sudo usually requires a PTY (cf. requiretty option), therefore
# we give it one by default (pty=True in ansble.cfg), and we try
# to initialise from the calling environment
if C.PARAMIKO_PTY:
# to initialise from the calling environment when sudoable is enabled
if C.PARAMIKO_PTY and sudoable:
chan.get_pty(term=os.getenv('TERM', 'vt100'), width=int(os.getenv('COLUMNS', 0)), height=int(os.getenv('LINES', 0)))
display.vvv("EXEC %s" % cmd, host=self._play_context.remote_addr)