Created
December 11, 2013 18:53
-
-
Save omgjlk/7916239 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/ansible/runner/connection_plugins/ssh.py b/lib/ansible/runner/con | |
index 68c6f17..3007304 100644 | |
--- a/lib/ansible/runner/connection_plugins/ssh.py | |
+++ b/lib/ansible/runner/connection_plugins/ssh.py | |
@@ -228,18 +228,20 @@ class Connection(object): | |
raise errors.AnsibleError('Incorrect sudo password') | |
if p.stdout in rfd: | |
- dat = os.read(p.stdout.fileno(), 9000) | |
+ dat = p.stdout.read(9000) | |
stdout += dat | |
if dat == '': | |
rpipes.remove(p.stdout) | |
if p.stderr in rfd: | |
- dat = os.read(p.stderr.fileno(), 9000) | |
+ dat = p.stderr.read(9000) | |
stderr += dat | |
if dat == '': | |
rpipes.remove(p.stderr) | |
- if not rpipes or p.poll() is not None: | |
- p.wait() | |
+ if not rpipes and p.poll() is not None: | |
break | |
+ elif p.poll() == None: | |
+ p.wait() | |
+ | |
stdin.close() # close stdin after we read from stdout (see also issue #84 | |
if C.HOST_KEY_CHECKING and not_in_host_file: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment