Commit bdec9e70 by Michael DeHaan

Merge pull request #496 from davehatton/fix_stderr

change STDOUT to PIPE  to get ssh connection module working
parents 25083953 30d4f070
...@@ -76,7 +76,7 @@ class SSHConnection(object): ...@@ -76,7 +76,7 @@ class SSHConnection(object):
sudo_output = '' sudo_output = ''
ssh_cmd.append(sudocmd) ssh_cmd.append(sudocmd)
p = subprocess.Popen(ssh_cmd, stdin=subprocess.PIPE, p = subprocess.Popen(ssh_cmd, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT) stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if self.runner.sudo_pass: if self.runner.sudo_pass:
fcntl.fcntl(p.stdout, fcntl.F_SETFL, fcntl.fcntl(p.stdout, fcntl.F_SETFL,
fcntl.fcntl(p.stdout, fcntl.F_GETFL) | os.O_NONBLOCK) fcntl.fcntl(p.stdout, fcntl.F_GETFL) | os.O_NONBLOCK)
...@@ -96,7 +96,7 @@ class SSHConnection(object): ...@@ -96,7 +96,7 @@ class SSHConnection(object):
else: else:
ssh_cmd.append(cmd) ssh_cmd.append(cmd)
p = subprocess.Popen(ssh_cmd, stdin=subprocess.PIPE, p = subprocess.Popen(ssh_cmd, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT) stdout=subprocess.PIPE, stderr=subprocess.PIPE)
# We can't use p.communicate here because the ControlMaster may have stdout open as well # We can't use p.communicate here because the ControlMaster may have stdout open as well
p.stdin.close() p.stdin.close()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment