mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[Rackspace|Compute] updated ready method on Image to raise an exception if an error state occurs. This is similar to the behavior of Server.
This commit is contained in:
parent
4a1bfa99ed
commit
c2122b7ac1
1 changed files with 7 additions and 2 deletions
|
@ -46,9 +46,14 @@ module Fog
|
|||
metadata.from_hash(hash)
|
||||
end
|
||||
|
||||
def ready?
|
||||
state == ACTIVE
|
||||
def ready?(ready_state = ACTIVE, error_states=[ERROR])
|
||||
if error_states
|
||||
error_states = Array(error_states)
|
||||
raise "Image should have transitioned to '#{ready_state}' not '#{state}'" if error_states.include?(state)
|
||||
end
|
||||
state == ready_state
|
||||
end
|
||||
|
||||
|
||||
def destroy
|
||||
requires :identity
|
||||
|
|
Loading…
Add table
Reference in a new issue