From 446870d8a6e5e7f92b06afb2f32936ec56483c4d Mon Sep 17 00:00:00 2001 From: George Scott Date: Wed, 28 Mar 2012 10:48:06 -0700 Subject: [PATCH] [aws|dns] Allow both Ruby and AWS style names for alias. It was not possible to delete AWS DNS Alias Records because retrieved records use CamelCase for alias target keys and change_resource_records required ruby style names. It now accepts both. --- lib/fog/aws/requests/dns/change_resource_record_sets.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/fog/aws/requests/dns/change_resource_record_sets.rb b/lib/fog/aws/requests/dns/change_resource_record_sets.rb index 0f07ae74b..d177fd33a 100644 --- a/lib/fog/aws/requests/dns/change_resource_record_sets.rb +++ b/lib/fog/aws/requests/dns/change_resource_record_sets.rb @@ -70,7 +70,10 @@ module Fog alias_target_tag = '' if change_item[:alias_target] - alias_target_tag += %Q{#{change_item[:alias_target][:hosted_zone_id]}#{change_item[:alias_target][:dns_name]}} + # Accept either underscore or camel case for hash keys. + hosted_zone_id = change_item[:alias_target][:hosted_zone_id] || change_item[:alias_target][:HostedZoneId] + dns_name = change_item[:alias_target][:dns_name] || change_item[:alias_target][:DNSName] + alias_target_tag += %Q{#{hosted_zone_id}#{dns_name}} end change_tags = %Q{#{action_tag}#{name_tag}#{type_tag}#{ttl_tag}#{resource_tag}#{alias_target_tag}}