From 48e0d3f200eda4b0cee256773bdd8d01fbbdc4fa Mon Sep 17 00:00:00 2001 From: Adam Bozanich Date: Tue, 12 Feb 2013 14:34:48 -0800 Subject: [PATCH] test spot instance request parser --- lib/fog/aws/parsers/compute/spot_instance_requests.rb | 2 ++ tests/aws/requests/compute/spot_instance_tests.rb | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/fog/aws/parsers/compute/spot_instance_requests.rb b/lib/fog/aws/parsers/compute/spot_instance_requests.rb index efa4e674f..53454a0cb 100644 --- a/lib/fog/aws/parsers/compute/spot_instance_requests.rb +++ b/lib/fog/aws/parsers/compute/spot_instance_requests.rb @@ -52,6 +52,8 @@ module Fog end when 'imageId', 'instanceType', 'keyname', 'subnetId' @spot_instance_request['launchSpecification'][name] = value + when 'ebsOptimized' + @spot_instance_request['launchSpecification'][name] = value == 'true' when 'enabled' @spot_instance_request['launchSpecification']['monitoring'] = (value == 'true') when 'requestId' diff --git a/tests/aws/requests/compute/spot_instance_tests.rb b/tests/aws/requests/compute/spot_instance_tests.rb index 57c634897..9a65fdfcd 100644 --- a/tests/aws/requests/compute/spot_instance_tests.rb +++ b/tests/aws/requests/compute/spot_instance_tests.rb @@ -12,6 +12,7 @@ Shindo.tests('Fog::Compute[:aws] | spot instance requests', ['aws']) do 'imageId' => String, 'instanceType' => String, 'monitoring' => Fog::Boolean, + 'ebsOptimized' => Fog::Boolean, 'subnetId' => Fog::Nullable::String, 'iamInstanceProfile' => Fog::Nullable::Hash, }, @@ -38,13 +39,13 @@ Shindo.tests('Fog::Compute[:aws] | spot instance requests', ['aws']) do pending if Fog.mocking? tests("#request_spot_instances('ami-3202f25b', 't1.micro', '0.001')").formats(@spot_instance_requests_format) do - data = Fog::Compute[:aws].request_spot_instances('ami-3202f25b', 't1.micro', '0.001').body + data = Fog::Compute[:aws].request_spot_instances('ami-3202f25b', 't1.micro', '0.001',{'LaunchSpecification.EbsOptimized' => false}).body @spot_instance_request_id = data['spotInstanceRequestSet'].first['spotInstanceRequestId'] data end tests("#describe_spot_instance_requests").formats(@spot_instance_requests_format) do - Fog::Compute[:aws].describe_spot_instance_requests.body + Fog::Compute[:aws].describe_spot_instance_requests('spot-instance-request-id' => [@spot_instance_request_id]).body end tests("#cancel_spot_instance_requests('#{@spot_instance_request_id}')").formats(@cancel_spot_instance_request_format) do