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

Merge pull request #927 from freeformz/remove_ssh_debug

Revert "Add debug option to Fog::Compute::Server#ssh"
This commit is contained in:
Edward Muller 2012-05-29 07:58:15 -07:00
commit 0ed426b714

View file

@ -48,7 +48,6 @@ module Fog
@address = address
@username = username
@debug = options.delete :debug
@options = { :paranoid => false }.merge(options)
end
@ -58,7 +57,7 @@ module Fog
begin
Net::SSH.start(@address, @username, @options) do |ssh|
commands.each do |command|
result = Result.new(command, @debug)
result = Result.new(command)
ssh.open_channel do |ssh_channel|
ssh_channel.request_pty
ssh_channel.exec(command) do |channel, success|
@ -100,19 +99,6 @@ module Fog
end
class DebugString < SimpleDelegator
def initialize(string='')
super
end
def <<(add_me)
puts add_me
super
end
end
class Result
attr_accessor :command, :stderr, :stdout, :status
@ -130,10 +116,10 @@ module Fog
Formatador.display_line(stderr.split("\r\n"))
end
def initialize(command, debug=false)
def initialize(command)
@command = command
@stderr = debug ? DebugString.new : ''
@stdout = debug ? DebugString.new : ''
@stderr = ''
@stdout = ''
end
end