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

Merge pull request #1246 from masterzen/fix/1245

[aws|compute] Fix #1245 - mock register_image fails with block device mapping
This commit is contained in:
Wesley Beary 2012-11-04 08:51:42 -08:00
commit f204c41e55
2 changed files with 9 additions and 1 deletions

View file

@ -102,7 +102,7 @@ module Fog
'ebs' => {} 'ebs' => {}
} }
["DeviceName","VirtualName"].each do |n| ["DeviceName","VirtualName"].each do |n|
block_device_mapping = bd[n] if bd[n] block_device_mapping[n] = bd[n] if bd[n]
end end
["SnapshotId","VolumeSize","NoDevice","DeleteOnTermination"].each do |n| ["SnapshotId","VolumeSize","NoDevice","DeleteOnTermination"].each do |n|
block_device_mapping['ebs'][n] = bd[n] if bd[n] block_device_mapping['ebs'][n] = bd[n] if bd[n]

View file

@ -73,6 +73,14 @@ Shindo.tests('Fog::Compute[:aws] | image requests', ['aws']) do
@image = Fog::Compute[:aws].register_image('image', 'image', '/dev/sda1').body @image = Fog::Compute[:aws].register_image('image', 'image', '/dev/sda1').body
end end
tests("#register_image - with ebs block device mapping").formats(@register_image_format) do
@ebs_image = Fog::Compute[:aws].register_image('image', 'image', '/dev/sda1', [ { 'DeviceName' => '/dev/sdh', "SnapshotId" => "snap-123456789", "VolumeSize" => "10G", "DeleteOnTermination" => true}]).body
end
tests("#register_image - with ephemeral block device mapping").formats(@register_image_format) do
@ephemeral_image = Fog::Compute[:aws].register_image('image', 'image', '/dev/sda1', [ { 'VirtualName' => 'ephemeral0', "DeviceName" => "/dev/sdb"} ]).body
end
@image_id = @image['imageId'] @image_id = @image['imageId']
sleep 1 sleep 1