mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Merge remote branch 'pvande/master'
This commit is contained in:
commit
839191dd0a
1 changed files with 2 additions and 3 deletions
|
@ -51,11 +51,10 @@ module Fog
|
||||||
begin
|
begin
|
||||||
Net::SSH.start(@address, @username, @options) do |ssh|
|
Net::SSH.start(@address, @username, @options) do |ssh|
|
||||||
commands.each do |command|
|
commands.each do |command|
|
||||||
escaped_command = command.sub(/'/, %{'"'"'})
|
result = Result.new(command)
|
||||||
result = Result.new(escaped_command)
|
|
||||||
ssh.open_channel do |ssh_channel|
|
ssh.open_channel do |ssh_channel|
|
||||||
ssh_channel.request_pty
|
ssh_channel.request_pty
|
||||||
ssh_channel.exec(%{bash -lc '#{escaped_command}'}) do |channel, success|
|
ssh_channel.exec(command) do |channel, success|
|
||||||
unless success
|
unless success
|
||||||
raise "Could not execute command: #{command.inspect}"
|
raise "Could not execute command: #{command.inspect}"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue