1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Merge pull request #5254 from j2sol/fix-ssh-missing-quotes

Make sure ssh pipes are empty before moving on
This commit is contained in:
jctanner 2013-12-12 07:01:35 -08:00
commit 5c5042102f

View file

@ -237,9 +237,13 @@ class Connection(object):
stderr += dat stderr += dat
if dat == '': if dat == '':
rpipes.remove(p.stderr) rpipes.remove(p.stderr)
if not rpipes or p.poll() is not None: # only break out if we've emptied the pipes, or there is nothing to
p.wait() # read from and the process has finished.
if (not rpipes or not rfd) and p.poll() is not None:
break break
# Calling wait while there are still pipes to read can cause a lock
elif not rpipes and p.poll() == None:
p.wait()
stdin.close() # close stdin after we read from stdout (see also issue #848) stdin.close() # close stdin after we read from stdout (see also issue #848)
if C.HOST_KEY_CHECKING and not_in_host_file: if C.HOST_KEY_CHECKING and not_in_host_file: