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

[ec2] small fixes for mock inconsistencies

This commit is contained in:
geemus (Wesley Beary) 2010-03-31 21:28:32 -07:00
parent ae5041d304
commit 49ad07201e
2 changed files with 6 additions and 3 deletions

View file

@ -49,7 +49,7 @@ module Fog
'status' => 'attaching',
'volumeId' => volume_id
}
volume['attachmentSet'] << data
volume['attachmentSet'] = [data]
response.status = 200
response.body = {
'requestId' => Fog::AWS::Mock.request_id

View file

@ -80,11 +80,14 @@ module Fog
when 'rebooting'
instance['instanceState'] = { 'code' => 16, 'name' => 'running' }
when 'shutting-down'
if Time.now - @data[:deleted_at][instance['instanceId']] > 2
if Time.now - @data[:deleted_at][instance['instanceId']] > 1
instance['instanceState'] = { 'code' => 16, 'name' => 'terminating' }
elsif Time.now - @data[:deleted_at][instance['instanceId']] > 2
@data[:deleted_at].delete(instance['instanceId'])
@data[:instances].delete(instance['instanceId'])
end
when 'terminating'
if Time.now - @data[:deleted_at][instance['instanceId']] > 4
if Time.now - @data[:deleted_at][instance['instanceId']] > 1
@data[:deleted_at].delete(instance['instanceId'])
@data[:instances].delete(instance['instanceId'])
end