mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[ec2] update snapshot mocks to match recent parser updates
This commit is contained in:
parent
04ecade81b
commit
9d2cea276a
2 changed files with 9 additions and 3 deletions
|
@ -30,17 +30,20 @@ module Fog
|
|||
|
||||
class Mock
|
||||
|
||||
def create_snapshot(volume_id)
|
||||
def create_snapshot(volume_id, description = nil)
|
||||
response = Excon::Response.new
|
||||
if @data[:volumes][volume_id]
|
||||
if volume = @data[:volumes][volume_id]
|
||||
response.status = 200
|
||||
snapshot_id = Fog::AWS::Mock.snapshot_id
|
||||
data = {
|
||||
'description' => description,
|
||||
'ownerId' => @owner_id,
|
||||
'progress' => nil,
|
||||
'snapshotId' => snapshot_id,
|
||||
'startTime' => Time.now,
|
||||
'status' => 'pending',
|
||||
'volumeId' => volume_id
|
||||
'volumeId' => volume_id,
|
||||
'volumeSize' => volume['size']
|
||||
}
|
||||
@data[:snapshots][snapshot_id] = data
|
||||
response.body = {
|
||||
|
|
|
@ -53,6 +53,9 @@ module Fog
|
|||
elsif Time.now - snapshot['startTime'] > Fog::Mock.delay
|
||||
snapshot['progress'] = '50%'
|
||||
snapshot['status'] = 'in progress'
|
||||
else
|
||||
snapshot['progress'] = '0%'
|
||||
snapshot['status'] = 'in progress'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue