1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

remove weird sudo related ssh stuff and don't memoize ssh connection

This commit is contained in:
geemus 2010-10-20 16:22:31 -07:00
parent 2c7477a9e2
commit 8aec42583e
5 changed files with 5 additions and 10 deletions

View file

@ -182,8 +182,7 @@ module Fog
def ssh(commands)
requires :identity, :ip_address, :private_key, :username
@ssh ||= Fog::SSH.new(ip_address, username, :key_data => [private_key])
@ssh.run(commands)
Fog::SSH.new(ip_address, username, :key_data => [private_key]).run(commands)
end
def start

View file

@ -109,8 +109,7 @@ module Fog
def ssh(commands)
requires :identity, :ips, :private_key, :username
@ssh ||= Fog::SSH.new(ips.first['address'], username, :key_data => [private_key])
@ssh.run(commands)
Fog::SSH.new(ips.first['address'], username, :key_data => [private_key]).run(commands)
end
def username

View file

@ -51,8 +51,7 @@ module Fog
begin
Net::SSH.start(@address, @username, @options) do |ssh|
commands.each do |command|
sudoable_command = command.sub(/^sudo/, %{sudo -p 'fog sudo password:'})
escaped_command = sudoable_command.sub(/'/, %{'"'"'})
escaped_command = command.sub(/'/, %{'"'"'})
result = Result.new(escaped_command)
ssh.open_channel do |ssh_channel|
ssh_channel.request_pty

View file

@ -105,8 +105,7 @@ module Fog
def ssh(commands)
requires :addresses, :identity, :private_key, :username
@ssh ||= Fog::SSH.new(addresses['public'].first, username, :key_data => [private_key])
@ssh.run(commands)
Fog::SSH.new(addresses['public'].first, username, :key_data => [private_key]).run(commands)
end
def username

View file

@ -95,8 +95,7 @@ module Fog
def ssh(commands)
requires :addresses, :identity, :private_key, :username
@ssh ||= Fog::SSH.new(addresses.first, username, :key_data => [private_key])
@ssh.run(commands)
Fog::SSH.new(addresses.first, username, :key_data => [private_key]).run(commands)
end
def username