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

cleaned up some warnings & fixed problem building gem because of missing files

This commit is contained in:
Athir Nuaimi 2010-10-13 16:42:11 +08:00 committed by Wesley Beary
parent 46fdab47e5
commit 6c929091bc
6 changed files with 18 additions and 23 deletions

View file

@ -563,16 +563,11 @@ Gem::Specification.new do |s|
spec/aws/requests/simpledb/put_attributes_spec.rb
spec/aws/requests/simpledb/select_spec.rb
spec/aws/requests/storage/copy_object_spec.rb
spec/aws/requests/storage/delete_bucket_spec.rb
spec/aws/requests/storage/delete_object_spec.rb
spec/aws/requests/storage/get_bucket_location_spec.rb
spec/aws/requests/storage/get_bucket_spec.rb
spec/aws/requests/storage/get_object_spec.rb
spec/aws/requests/storage/get_request_payment_spec.rb
spec/aws/requests/storage/get_service_spec.rb
spec/aws/requests/storage/head_object_spec.rb
spec/aws/requests/storage/put_bucket_spec.rb
spec/aws/requests/storage/put_object_spec.rb
spec/aws/requests/storage/put_request_payment_spec.rb
spec/bluebox/models/compute/flavors_spec.rb
spec/bluebox/models/compute/server_spec.rb

View file

@ -54,27 +54,27 @@ module Fog
sudoable_command = command.sub(/^sudo/, %{sudo -p 'fog sudo password:'})
escaped_command = sudoable_command.sub(/'/, %{'"'"'})
result = Result.new(escaped_command)
ssh.open_channel do |channel|
channel.request_pty
channel.exec(%{bash -lc '#{escaped_command}'}) do |channel, success|
ssh.open_channel do |ssh_channel|
ssh_channel.request_pty
ssh_channel.exec(%{bash -lc '#{escaped_command}'}) do |channel, success|
unless success
raise "Could not execute command: #{command.inspect}"
end
channel.on_data do |channel, data|
channel.on_data do |ch, data|
result.stdout << data
end
channel.on_extended_data do |channel, type, data|
channel.on_extended_data do |ch, type, data|
next unless type == 1
result.stderr << data
end
channel.on_request('exit-status') do |channel, data|
channel.on_request('exit-status') do |ch, data|
result.status = data.read_long
end
channel.on_request('exit-signal') do |channel, data|
channel.on_request('exit-signal') do |ch, data|
result.status = 255
end
end

View file

@ -1,6 +1,6 @@
module Fog
module Local
class Storage < Fog::Service
class Storage < Fog::Service
requires :local_root

View file

@ -25,9 +25,9 @@ module Fog
if Fog.mocking?
Fog::Terremark::Ecloud::Mock.new(options)
else
else
Fog::Terremark::Ecloud::Real.new(options)
end
end
end
class Real
@ -45,7 +45,7 @@ module Fog
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", options[:persistent])
end
end
end
class Mock
include Fog::Terremark::Shared::Mock
@ -60,7 +60,7 @@ module Fog
end
end
end
end
end
end

View file

@ -25,9 +25,9 @@ module Fog
if Fog.mocking?
Fog::Terremark::Vcloud::Mock.new(options)
else
else
Fog::Terremark::Vcloud::Real.new(options)
end
end
end
class Real
@ -91,7 +91,7 @@ module Fog
nil
end
end
end
end
class Mock
include Fog::Terremark::Shared::Mock
@ -106,7 +106,7 @@ module Fog
end
end
end
end
end
end

View file

@ -179,8 +179,8 @@ module Fog
def mock_ip_and_service_from_service_url(uri)
if ip = mock_data[:organizations].map { |org| org[:vdcs] }.flatten.map { |vdc| vdc[:public_ips] }.flatten.compact.detect { |pip| pip[:services].detect { |service| service[:href] == uri } }
if service = ip[:services].detect { |service| service[:href] == uri }
[ip, service]
if desired_service = ip[:services].detect { |service| service[:href] == uri }
[ip, desired_service]
else
[ip, nil]
end