From 400fa1ee3f76d2ca6abbfd413b0f44ca411b6ae4 Mon Sep 17 00:00:00 2001 From: Thibault Jouan Date: Wed, 5 Mar 2014 05:23:08 +0000 Subject: [PATCH] Fix unexpected blocking in Remote::execute: Wait for inactivity on the specific channel we open for the execution instead of looping the global session. --- lib/producer/core/remote.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/producer/core/remote.rb b/lib/producer/core/remote.rb index 06fd525..bb11a22 100644 --- a/lib/producer/core/remote.rb +++ b/lib/producer/core/remote.rb @@ -25,7 +25,7 @@ module Producer def execute(command) output = '' - session.open_channel do |channel| + channel = session.open_channel do |channel| channel.exec command do |ch, success| ch.on_data do |c, data| output << data @@ -37,7 +37,7 @@ module Producer end end end - session.loop + channel.wait output end