mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[rackspace] wrapping test blocks around test helpers to prevent unexpected shindo exceptions
This commit is contained in:
parent
709e5ecd5f
commit
68113cb3ee
1 changed files with 31 additions and 25 deletions
|
@ -42,14 +42,17 @@ module Shindo
|
|||
|
||||
def wait_for_server_deletion(server)
|
||||
return if Fog.mocking?
|
||||
tests('wait_for_server_deletion') do
|
||||
begin
|
||||
@instance.wait_for { state = 'DELETED' }
|
||||
server.wait_for { state = 'DELETED' }
|
||||
rescue Fog::Compute::RackspaceV2::NotFound => e
|
||||
# do nothing
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def wait_for_server_state(service, server_id, state, error_states=nil)
|
||||
tests("wait_for_server_state('#{state}')") do
|
||||
current_state = nil
|
||||
until current_state == state
|
||||
current_state = service.get_server(server_id).body['server']['status']
|
||||
|
@ -61,6 +64,7 @@ module Shindo
|
|||
end
|
||||
sleep 30 unless Fog.mocking?
|
||||
end
|
||||
end
|
||||
|
||||
def rackspace_test_image_id(service)
|
||||
# I chose to use the first Ubuntu because it will work with the smallest flavor and it doesn't require a license
|
||||
|
@ -74,6 +78,7 @@ module Shindo
|
|||
# After a server has been successfully deleted they are still being reported as attached to a cloud network
|
||||
# causing delete calls to fail. This method attempts to address that.
|
||||
def delete_test_network(network)
|
||||
tests('delete_test_network') do
|
||||
return false if Fog.mocking? || network.nil?
|
||||
attempt = 0
|
||||
begin
|
||||
|
@ -92,3 +97,4 @@ module Shindo
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Reference in a new issue