diff --git a/lib/fog/dynect/models/dns/record.rb b/lib/fog/dynect/models/dns/record.rb index 7478d207f..9be7eeaea 100644 --- a/lib/fog/dynect/models/dns/record.rb +++ b/lib/fog/dynect/models/dns/record.rb @@ -13,7 +13,6 @@ module Fog attribute :serial_style attribute :ttl attribute :type, :aliases => 'record_type' - attribute :value def destroy requires :identity, :name, :type, :zone @@ -22,14 +21,14 @@ module Fog end def save - requires :name, :type, :value, :zone + requires :name, :type, :rdata, :zone options = { :ttl => ttl } options.delete_if {|key, value| value.nil?} - data = connection.post_record(type, zone.identity, name, {'address' => value}, options).body['data'] + data = connection.post_record(type, zone.identity, name, rdata, options).body['data'] # avoid overwriting zone object with zone string data = data.reject {|key, value| key == 'zone'} merge_attributes(data) diff --git a/tests/dns/requests/dynect/dns_tests.rb b/tests/dns/requests/dynect/dns_tests.rb index 26f36a75a..590fdf3b0 100644 --- a/tests/dns/requests/dynect/dns_tests.rb +++ b/tests/dns/requests/dynect/dns_tests.rb @@ -76,7 +76,7 @@ Shindo.tests('Dynect::dns | DNS requests', ['dynect', 'dns']) do }) tests("post_record('A', '#{@domain}', '#{@fqdn}', 'address' => '1.2.3.4')").formats(post_record_format) do - @dns.post_record('A', @domain, @fqdn, {'address' => '1.2.3.4'}, {}).body + @dns.post_record('A', @domain, @fqdn, {'address' => '1.2.3.4'}).body end publish_zone_format = shared_format.merge({ @@ -126,10 +126,12 @@ Shindo.tests('Dynect::dns | DNS requests', ['dynect', 'dns']) do data end - @dns.post_record('CNAME', @domain, @fqdn, {'address' => '1.2.3.4'}, {}) + sleep 3 unless Fog.mocking? - tests("get_record('ANY', '#{@domain}', '#{@fqdn}')").formats(get_records_format) do - @dns.get_record('ANY', @domain, @fqdn) + @dns.post_record('CNAME', @domain, "cname.#{@fqdn}", {'cname' => "#{@fqdn}."}) + + tests("get_record('ANY', '#{@domain}', 'cname.#{@fqdn}')").formats(get_records_format) do + @dns.get_record('ANY', @domain, "cname.#{@fqdn}").body end get_record_format = shared_format.merge({