From a6e01e3dce84daad432af9eb9313564ff8fe4064 Mon Sep 17 00:00:00 2001 From: Corbin Fox Date: Tue, 7 Jun 2011 15:01:08 -0700 Subject: [PATCH] Added cg1.4xlarge instance type to those accepted by describe_spot_price_history(). --- lib/AWS/EC2/spot_prices.rb | 2 +- test/test_EC2_spot_prices.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/AWS/EC2/spot_prices.rb b/lib/AWS/EC2/spot_prices.rb index 5f7cdd9..c0c9c7f 100644 --- a/lib/AWS/EC2/spot_prices.rb +++ b/lib/AWS/EC2/spot_prices.rb @@ -16,7 +16,7 @@ class Base < AWS::Base def describe_spot_price_history( options = {} ) raise ArgumentError, ":start_time must be a Time object" unless options[:start_time].nil? || options[:start_time].kind_of?(Time) raise ArgumentError, ":end_time must be a Time object" unless options[:end_time].nil? || options[:end_time].kind_of?(Time) - raise ArgumentError, ":instance_type must specify a valid instance type" unless options[:instance_type].nil? || ["t1.micro", "m1.small", "m1.large", "m1.xlarge", "m2.xlarge", "c1.medium", "c1.xlarge", "m2.2xlarge", "m2.4xlarge", "cc1.4xlarge"].include?(options[:instance_type]) + raise ArgumentError, ":instance_type must specify a valid instance type" unless options[:instance_type].nil? || ["t1.micro", "m1.small", "m1.large", "m1.xlarge", "m2.xlarge", "c1.medium", "c1.xlarge", "m2.2xlarge", "m2.4xlarge", "cc1.4xlarge", "cg1.4xlarge"].include?(options[:instance_type]) raise ArgumentError, ":product_description must be 'Linux/UNIX' or 'Windows'" unless options[:product_description].nil? || ["Linux/UNIX", "Windows"].include?(options[:product_description]) params = {} diff --git a/test/test_EC2_spot_prices.rb b/test/test_EC2_spot_prices.rb index 485d885..ec9b63d 100644 --- a/test/test_EC2_spot_prices.rb +++ b/test/test_EC2_spot_prices.rb @@ -41,7 +41,7 @@ end specify "should be able to be requested with various instance types" do - ["t1.micro", "m1.small", "m1.large", "m1.xlarge", "m2.xlarge", "c1.medium", "c1.xlarge", "m2.2xlarge", "m2.4xlarge", "cc1.4xlarge"].each do |type| + ["t1.micro", "m1.small", "m1.large", "m1.xlarge", "m2.xlarge", "c1.medium", "c1.xlarge", "m2.2xlarge", "m2.4xlarge", "cc1.4xlarge", "cg1.4xlarge"].each do |type| @ec2.stubs(:make_request).with('DescribeSpotPriceHistory', {'InstanceType' => type}). returns stub(:body => @describe_spot_price_history_response_body, :is_a? => true) lambda { @ec2.describe_spot_price_history( :instance_type => type ) }.should.not.raise(AWS::ArgumentError)