Get output before receiving return code
Fixes hangs observed with large amounts of output, as it would get into a dead-lock.pull/4420/head
parent
4d8f3b0924
commit
e166f71fcc
|
@ -142,7 +142,9 @@ class Connection(object):
|
||||||
except socket.timeout:
|
except socket.timeout:
|
||||||
raise errors.AnsibleError('ssh timed out waiting for sudo.\n' + sudo_output)
|
raise errors.AnsibleError('ssh timed out waiting for sudo.\n' + sudo_output)
|
||||||
|
|
||||||
return (chan.recv_exit_status(), chan.makefile('wb', bufsize), chan.makefile('rb', bufsize), chan.makefile_stderr('rb', bufsize))
|
stdout = ''.join(chan.makefile('rb', bufsize))
|
||||||
|
stderr = ''.join(chan.makefile_stderr('rb', bufsize))
|
||||||
|
return (chan.recv_exit_status(), '', stdout, stderr)
|
||||||
|
|
||||||
def put_file(self, in_path, out_path):
|
def put_file(self, in_path, out_path):
|
||||||
''' transfer a file from local to remote '''
|
''' transfer a file from local to remote '''
|
||||||
|
|
Loading…
Reference in New Issue