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:
parent
ae5041d304
commit
49ad07201e
2 changed files with 6 additions and 3 deletions
lib/fog/aws/requests/ec2
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue