From 7a15c7be1d2c2e641e9ebb1616c2aa7a4c30f46b Mon Sep 17 00:00:00 2001 From: Wesley Beary Date: Wed, 21 Oct 2009 18:50:15 -0700 Subject: [PATCH] properly parse availability zone in instance model --- lib/fog/aws/models/ec2/instance.rb | 2 +- spec/aws/models/ec2/instance_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/fog/aws/models/ec2/instance.rb b/lib/fog/aws/models/ec2/instance.rb index 5c74e04ad..e623a9dd5 100644 --- a/lib/fog/aws/models/ec2/instance.rb +++ b/lib/fog/aws/models/ec2/instance.rb @@ -60,7 +60,7 @@ module Fog end def placement=(new_placement) - if placement.is_a?(Hash) + if new_placement.is_a?(Hash) @availability_zone = new_placement['availabilityZone'] else @availability_zone = new_placement diff --git a/spec/aws/models/ec2/instance_spec.rb b/spec/aws/models/ec2/instance_spec.rb index f7e1d3bde..81e7c6d5f 100644 --- a/spec/aws/models/ec2/instance_spec.rb +++ b/spec/aws/models/ec2/instance_spec.rb @@ -7,7 +7,6 @@ describe 'Fog::AWS::EC2::Instance' do it "should remap attributes from parser" do instance = Fog::AWS::EC2::Instance.new({ 'amiLaunchIndex' => 'ami_launch_index', - 'availabilityZone' => 'availability_zone', 'dnsName' => 'dns_name', 'groupId' => 'group_id', 'imageId' => 'image_id', @@ -17,6 +16,7 @@ describe 'Fog::AWS::EC2::Instance' do 'kernelId' => 'kernel_id', 'keyName' => 'key_name', 'launchTime' => 'launch_time', + 'placement' => { 'availabilityZone' => 'availability_zone'}, 'productCodes' => 'product_codes', 'privateDnsName' => 'private_dns_name', 'ramdiskId' => 'ramdisk_id'