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

[aws|compute] descibe_images fixes

add virtualization_type to expected format in tests
move request_id off imageSet and back to top level
This commit is contained in:
geemus 2010-12-21 13:16:42 -08:00
parent 74e4288549
commit c15c4dbb2d
3 changed files with 19 additions and 15 deletions

View file

@ -47,7 +47,7 @@ module Fog
end end
else else
case name case name
when 'name','requestId','architecture', 'description', 'imageId', 'imageLocation', 'imageOwnerId', 'imageState', 'imageType', 'kernelId', 'platform', 'ramdiskId', 'rootDeviceType','rootDeviceName','virtualizationType' when 'architecture', 'description', 'imageId', 'imageLocation', 'imageOwnerId', 'imageState', 'imageType', 'kernelId', 'name', 'platform', 'ramdiskId', 'rootDeviceType','rootDeviceName','virtualizationType'
@image[name] = @value @image[name] = @value
when 'isPublic' when 'isPublic'
if @value == 'true' if @value == 'true'
@ -60,6 +60,8 @@ module Fog
@image = { 'blockDeviceMapping' => [], 'productCodes' => [], 'tagSet' => {} } @image = { 'blockDeviceMapping' => [], 'productCodes' => [], 'tagSet' => {} }
when 'productCode' when 'productCode'
@image['productCodes'] << @value @image['productCodes'] << @value
when 'requestId'
@response[name] = @value
end end
end end
end end

View file

@ -35,6 +35,7 @@ module Fog
# * 'ramdiskId'<~String> - Ramdisk id associated with image, if any # * 'ramdiskId'<~String> - Ramdisk id associated with image, if any
# * 'rootDeviceName'<~String> - Root device name, e.g. /dev/sda1 # * 'rootDeviceName'<~String> - Root device name, e.g. /dev/sda1
# * 'rootDeviceType'<~String> - Root device type, ebs or instance-store # * 'rootDeviceType'<~String> - Root device type, ebs or instance-store
# * 'virtualizationType'<~String> - Type of virtualization
def describe_images(filters = {}) def describe_images(filters = {})
options = {} options = {}
for key in ['ExecutableBy', 'ImageId', 'Owner'] for key in ['ExecutableBy', 'ImageId', 'Owner']

View file

@ -2,21 +2,22 @@ Shindo.tests('AWS::Compute | image requests', ['aws']) do
@images_format = { @images_format = {
'imagesSet' => [{ 'imagesSet' => [{
'architecture' => String, 'architecture' => String,
'blockDeviceMapping' =>[], 'blockDeviceMapping' =>[],
'imageId' => String, 'imageId' => String,
'imageLocation' => String, 'imageLocation' => String,
'imageOwnerId' => String, 'imageOwnerId' => String,
'imageState' => String, 'imageState' => String,
'imageType' => String, 'imageType' => String,
'isPublic' => Fog::Boolean, 'isPublic' => Fog::Boolean,
'kernelId' => String, 'kernelId' => String,
'productCodes' => [], 'productCodes' => [],
'ramdiskId' => String, 'ramdiskId' => String,
'rootDeviceType' => String, 'rootDeviceType' => String,
'tagSet' => {} 'tagSet' => {},
'virtualizationType' => String
}], }],
'requestId' => String, 'requestId' => String,
} }
tests('success') do tests('success') do