From 6cb9635bdb9f1ea7a7884ebc40c34ccb2698b87f Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Mon, 12 Sep 2016 11:54:31 +0200 Subject: [PATCH] f #4716: add timeout to SshStreamCommand#run --- src/mad/ruby/ssh_stream.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mad/ruby/ssh_stream.rb b/src/mad/ruby/ssh_stream.rb index a70a5e430b..8d9837cb2b 100644 --- a/src/mad/ruby/ssh_stream.rb +++ b/src/mad/ruby/ssh_stream.rb @@ -192,7 +192,9 @@ class SshStreamCommand < RemotesCommand @stream = SshStream.new(host, shell, timeout) end - def run(command, stdin=nil, base_cmd = nil) + def run(command, stdin=nil, base_cmd = nil, timeout = nil) + @timeout = timeout if timeout + @stream.open unless @stream.opened? if base_cmd #Check if base command is on remote host