lib/koma/backend/ssh.rb in koma-0.16.0 vs lib/koma/backend/ssh.rb in koma-0.17.0
- old
+ new
@@ -21,15 +21,14 @@
end
def run_commands(commands)
if host.include?(',')
list = host.split(',').uniq
- results = Parallel.map(list) do |h|
- run_commands_via_ssh(h, options, commands)
+ result = {}
+ list.each do |h|
+ result[h] = run_commands_via_ssh(h, options, commands)
end
- arr = [list, results].transpose
- result = Hash[*arr.flatten]
else
result = run_commands_via_ssh(host, options, commands)
end
result
end
@@ -55,9 +54,10 @@
end
private
def build_ssh_options(host, options)
+ Specinfra::Backend::Ssh.clear
user, host = host.split('@') if host.include?('@')
set :backend, :ssh
set :host, host
set :request_pty, true
if stdin