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

Whitespace cleanup of #3069.

This commit is contained in:
Nat Welch 2014-07-25 08:50:32 +00:00
parent e62c5407e1
commit ed7bc035b7
6 changed files with 34 additions and 39 deletions

View file

@ -2,24 +2,21 @@ require 'rubygems'
require 'fog'
def test
connection = Fog::Compute.new({ :provider => "google",
:google_project => "",
:google_client_email => "",
:google_key_location => ""
})
health = connection.http_health_checks.create({
:name => 'test-checks'
connection = Fog::Compute.new({:provider => "google"})
health = connection.http_health_checks.create({
:name => 'test-checks'
})
health.wait_for { health.ready? }
backend= connection.backend_services.create({
:name => 'backend-test',
:health_checks => [health.self_link],
:port => 8080,
:timeout_sec => 40,
:backends => [{'group' => 'resource_view self_link'}]
})
puts connection.backend_services.all
backend= connection.backend_services.get('backend-test')
backend.get_health
backend= connection.backend_services.create({
:name => 'backend-test',
:health_checks => [health.self_link],
:port => 8080,
:timeout_sec => 40,
:backends => [{'group' => 'resource_view self_link'}]
})
puts connection.backend_services.all
backend= connection.backend_services.get('backend-test')
backend.get_health
end
test

View file

@ -38,17 +38,18 @@ module Fog
end
def destroy(async=false)
requires :name
operation = service.delete_backend_service(name)
unless async
operation.wait_for { ready? }
end
operation
requires :name
operation = service.delete_backend_service(name)
unless async
operation.wait_for { ready? }
end
operation
end
def get_health
service.get_backend_service_health self
end
def ready?
begin
service.get_backend_service(self.name)
@ -61,11 +62,12 @@ module Fog
def reload
requires :name
return unless data = begin
collection.get(name)
rescue Excon::Errors::SocketError
nil
end
return unless data =
begin
collection.get(name)
rescue Excon::Errors::SocketError
nil
end
new_attributes = data.attributes
merge_attributes(new_attributes)
@ -76,5 +78,3 @@ module Fog
end
end
end

View file

@ -3,7 +3,7 @@ module Fog
class Google
class Mock
def delete_backend_service(backend_service_name)
Fog::Mock.not_implemented
Fog::Mock.not_implemented
end
end

View file

@ -14,12 +14,12 @@ module Fog
'project' => @project,
'backendService' => backend_service.name
}
health_results = backend_service.backends.map do |backend|
body = { 'group' => backend['group'] }
health_results = backend_service.backends.map do |backend|
body = { 'group' => backend['group'] }
resp = build_response(build_result(api_method, parameters, body_object= body))
[backend['group'], resp.data[:body]['healthStatus']]
end
Hash[health_results]
[backend['group'], resp.data[:body]['healthStatus']]
end
Hash[health_results]
end
end
end

View file

@ -3,7 +3,7 @@ module Fog
class Google
class Mock
def insert_backend_service(backend_service_name)
Fog::Mock.not_implemented
Fog::Mock.not_implemented
end
end
@ -23,4 +23,3 @@ module Fog
end
end
end

View file

@ -12,7 +12,6 @@ module Fog
api_method = @compute.backend_services.list
parameters = {
'project' => @project,
}
result = self.build_result(api_method, parameters)