From c15c4dbb2d86734dabbd3a5fc7f85c68b8f57987 Mon Sep 17 00:00:00 2001 From: geemus Date: Tue, 21 Dec 2010 13:16:42 -0800 Subject: [PATCH] [aws|compute] descibe_images fixes add virtualization_type to expected format in tests move request_id off imageSet and back to top level --- .../aws/parsers/compute/describe_images.rb | 4 ++- .../aws/requests/compute/describe_images.rb | 1 + tests/aws/requests/compute/image_tests.rb | 29 ++++++++++--------- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/lib/fog/aws/parsers/compute/describe_images.rb b/lib/fog/aws/parsers/compute/describe_images.rb index 89de28ac4..58634938c 100644 --- a/lib/fog/aws/parsers/compute/describe_images.rb +++ b/lib/fog/aws/parsers/compute/describe_images.rb @@ -47,7 +47,7 @@ module Fog end else 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 when 'isPublic' if @value == 'true' @@ -60,6 +60,8 @@ module Fog @image = { 'blockDeviceMapping' => [], 'productCodes' => [], 'tagSet' => {} } when 'productCode' @image['productCodes'] << @value + when 'requestId' + @response[name] = @value end end end diff --git a/lib/fog/aws/requests/compute/describe_images.rb b/lib/fog/aws/requests/compute/describe_images.rb index 2f0f2443f..fab6f69ab 100644 --- a/lib/fog/aws/requests/compute/describe_images.rb +++ b/lib/fog/aws/requests/compute/describe_images.rb @@ -35,6 +35,7 @@ module Fog # * 'ramdiskId'<~String> - Ramdisk id associated with image, if any # * 'rootDeviceName'<~String> - Root device name, e.g. /dev/sda1 # * 'rootDeviceType'<~String> - Root device type, ebs or instance-store + # * 'virtualizationType'<~String> - Type of virtualization def describe_images(filters = {}) options = {} for key in ['ExecutableBy', 'ImageId', 'Owner'] diff --git a/tests/aws/requests/compute/image_tests.rb b/tests/aws/requests/compute/image_tests.rb index e9ad002df..ce652dad9 100644 --- a/tests/aws/requests/compute/image_tests.rb +++ b/tests/aws/requests/compute/image_tests.rb @@ -2,21 +2,22 @@ Shindo.tests('AWS::Compute | image requests', ['aws']) do @images_format = { 'imagesSet' => [{ - 'architecture' => String, - 'blockDeviceMapping' =>[], - 'imageId' => String, - 'imageLocation' => String, - 'imageOwnerId' => String, - 'imageState' => String, - 'imageType' => String, - 'isPublic' => Fog::Boolean, - 'kernelId' => String, - 'productCodes' => [], - 'ramdiskId' => String, - 'rootDeviceType' => String, - 'tagSet' => {} + 'architecture' => String, + 'blockDeviceMapping' =>[], + 'imageId' => String, + 'imageLocation' => String, + 'imageOwnerId' => String, + 'imageState' => String, + 'imageType' => String, + 'isPublic' => Fog::Boolean, + 'kernelId' => String, + 'productCodes' => [], + 'ramdiskId' => String, + 'rootDeviceType' => String, + 'tagSet' => {}, + 'virtualizationType' => String }], - 'requestId' => String, + 'requestId' => String, } tests('success') do