Skip to content

Commit

Permalink
Merge branch 'fork_fixes' of https://github.com/akerl/ansible into ak…
Browse files Browse the repository at this point in the history
…erl-fork_fixes
  • Loading branch information
jimi-c committed Sep 19, 2013
2 parents 69cfcf7 + 98bf473 commit c840cba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/ansible/runner/connection_plugins/ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import hmac
import pwd
import gettext
import pty
from hashlib import sha1
import ansible.constants as C
from ansible.callbacks import vvv
Expand Down Expand Up @@ -181,11 +182,11 @@ def exec_command(self, cmd, tmp_path, sudo_user,sudoable=False, executable='/bin

try:
# Make sure stdin is a proper (pseudo) pty to avoid: tcgetattr errors
import pty
master, slave = pty.openpty()
p = subprocess.Popen(ssh_cmd, stdin=slave,
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdin = os.fdopen(master, 'w', 0)
os.close(slave)
except:
p = subprocess.Popen(ssh_cmd, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
Expand Down

0 comments on commit c840cba

Please sign in to comment.