1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

fix get, all, and all!

get and all returned AWS error responses about empty values being specified.  Existing shin do
tests already covered these cases as this:

FOG_MOCK=false bundle exec shindont tests/aws/models/dns/records_tests.rb

was reporting 6 failures.

Tests pass after fix.
This commit is contained in:
Michael Keirnan 2012-04-21 14:34:09 -04:00
parent 28c1d90d63
commit 298522644c

View file

@ -23,9 +23,10 @@ module Fog
def all(options = {})
requires :zone
options[:max_items] ||= max_items
options[:name] ||= name
options[:name] ||= zone.domain
options[:type] ||= type
options[:identifier] ||= identifier
options.delete_if {|key, value| value.nil?}
data = connection.list_resource_record_sets(zone.id, options).body
# NextRecordIdentifier is completely absent instead of nil, so set to nil, or iteration breaks.
@ -49,6 +50,8 @@ module Fog
:type => next_record_type,
:identifier => next_record_identifier
}
options.delete_if {|key, value| value.nil?}
batch = connection.list_resource_record_sets(zone.id, options).body
# NextRecordIdentifier is completely absent instead of nil, so set to nil, or iteration breaks.
batch['NextRecordIdentifier'] = nil unless batch.has_key?('NextRecordIdentifier')
@ -82,6 +85,7 @@ module Fog
:type => record_type,
:identifier => record_identifier
}
options.delete_if {|key, value| value.nil?}
data = connection.list_resource_record_sets(zone.id, options).body
# Get first record