From 2e55b3567bd2ad41e697418c5c145b53fc2e13ea Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Tue, 12 Apr 2016 08:34:24 -0400 Subject: [PATCH] Also fix intermittent ssh error using pty's for paramiko Related to #13876 --- lib/ansible/plugins/connection/paramiko_ssh.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/plugins/connection/paramiko_ssh.py b/lib/ansible/plugins/connection/paramiko_ssh.py index 88fbfbb8178..8bd5d660e8d 100644 --- a/lib/ansible/plugins/connection/paramiko_ssh.py +++ b/lib/ansible/plugins/connection/paramiko_ssh.py @@ -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)