From 3af3463c3cd81a77a88028cfe2b13b358657de62 Mon Sep 17 00:00:00 2001 From: Marc Bonnici Date: Tue, 29 Jun 2021 13:25:49 +0100 Subject: [PATCH] utils/ssh: Fix paramiko streams Ensure that we use the input stream for reading. --- devlib/utils/ssh.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devlib/utils/ssh.py b/devlib/utils/ssh.py index c32a1ea..ea4e222 100644 --- a/devlib/utils/ssh.py +++ b/devlib/utils/ssh.py @@ -691,11 +691,11 @@ class SshConnection(SshConnectionBase): w = os.fdopen(w, 'wb') # Turn a file descriptor into a file-like object elif isinstance(stream_out, int) and stream_out >= 0: - r = os.fdopen(stream_out, 'rb') + r = os.fdopen(stream_in, 'rb') w = os.fdopen(stream_out, 'wb') # file-like object else: - r = stream_out + r = stream_in w = stream_out return (r, w)