[ec2] small fixes for mock inconsistencies

This commit is contained in:
geemus (Wesley Beary) 2010-03-31 21:28:32 -07:00
Родитель ae5041d304
Коммит 49ad07201e
2 изменённых файлов: 6 добавлений и 3 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -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