From f9c8e87a8e3fc48bd122c86953ec87ac1be13a10 Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Tue, 15 Dec 2015 14:31:28 -0500 Subject: [PATCH] check both out and error for output before quiting Signed-off-by: Alfredo Deza --- remoto/process.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/remoto/process.py b/remoto/process.py index 3dc7d5e..4791725 100644 --- a/remoto/process.py +++ b/remoto/process.py @@ -44,21 +44,21 @@ def _remote_run(channel, cmd, **kw): while True: for descriptor in reads: if descriptor == process.stdout.fileno(): - read = process.stdout.readline() - if read: - channel.send({'debug': read}) + out_read = process.stdout.readline() + if out_read: + channel.send({'debug': out_read}) sys.stdout.flush() if descriptor == process.stderr.fileno(): - read = process.stderr.readline() - if read: - channel.send({'warning': read}) + err_read = process.stderr.readline() + if err_read: + channel.send({'warning': err_read}) sys.stderr.flush() # At this point we have gone through all the possible # descriptors and `read` was empty, so we now can break out of # this since all stdout/stderr has been properly flushed to # logging - if not read: + if not err_read and not out_read: break break -- 2.47.3