diff --git a/lib/fog/dns/models/bluebox/zone.rb b/lib/fog/dns/models/bluebox/zone.rb index a61a8fa89..7fc5adda6 100644 --- a/lib/fog/dns/models/bluebox/zone.rb +++ b/lib/fog/dns/models/bluebox/zone.rb @@ -9,12 +9,12 @@ module Fog identity :id - attribute :name + attribute :domain, :aliases => 'name' attribute :serial attribute :ttl attribute :retry attribute :expires - attribute :record_count, :aliases => 'record-count' + attribute :record_count, :aliases => 'record-count' attribute :refresh attribute :minimum @@ -50,8 +50,9 @@ module Fog end def save - requires :name, :ttl - options = attributes.inject({}) {|h, kv| h[kv[0]] = kv[1]; h} + requires :domain, :ttl + options = attributes.dup + options[:name] = options.delete(:domain) data = identity.nil? ? connection.create_zone(options) : connection.update_zone(identity, options) merge_attributes(data.body) true diff --git a/lib/fog/dns/models/dnsimple/zone.rb b/lib/fog/dns/models/dnsimple/zone.rb index 1a61c25da..decee5684 100644 --- a/lib/fog/dns/models/dnsimple/zone.rb +++ b/lib/fog/dns/models/dnsimple/zone.rb @@ -9,7 +9,7 @@ module Fog identity :id - attribute :domain, :aliases => [:name, 'name'] + attribute :domain, :aliases => 'name' attribute :created_at attribute :updated_at diff --git a/tests/dns/models/record_tests.rb b/tests/dns/models/record_tests.rb index 3dc5167c1..db98b606d 100644 --- a/tests/dns/models/record_tests.rb +++ b/tests/dns/models/record_tests.rb @@ -10,8 +10,7 @@ for provider, config in dns_providers if !Fog.mocking? || config[:mocked] zone_attributes = { - :name => 'fogrecordtests.com', - :ttl => 60 + :domain => 'fogrecordtests.com' }.merge(config[:zone_attributes] || {}) @zone = provider[:dns].zones.create(zone_attributes) diff --git a/tests/dns/models/records_tests.rb b/tests/dns/models/records_tests.rb index 70eb964d1..569ff3af2 100644 --- a/tests/dns/models/records_tests.rb +++ b/tests/dns/models/records_tests.rb @@ -10,7 +10,7 @@ for provider, config in dns_providers if !Fog.mocking? || config[:mocked] zone_attributes = { - :name => 'fogrecordstests.com' + :domain => 'fogrecordstests.com' }.merge(config[:zone_attributes] || {}) @zone = provider[:dns].zones.create(zone_attributes) diff --git a/tests/dns/models/zone_tests.rb b/tests/dns/models/zone_tests.rb index da03d1d3e..dbb1b68fb 100644 --- a/tests/dns/models/zone_tests.rb +++ b/tests/dns/models/zone_tests.rb @@ -3,7 +3,7 @@ for provider, config in dns_providers Shindo.tests("#{provider}::DNS | zone", [provider.to_s.downcase]) do zone_attributes = { - :name => 'fogzonetests.com' + :domain => 'fogzonetests.com' }.merge!(config[:zone_attributes] || {}) model_tests(provider[:dns].zones, zone_attributes, config[:mocked]) diff --git a/tests/dns/models/zones_tests.rb b/tests/dns/models/zones_tests.rb index fefe284ca..a2a632bf3 100644 --- a/tests/dns/models/zones_tests.rb +++ b/tests/dns/models/zones_tests.rb @@ -3,8 +3,7 @@ for provider, config in dns_providers Shindo.tests("#{provider}::DNS | zones", [provider.to_s.downcase]) do zone_attributes = { - :name => 'fogzonestests.com', - :ttl => 60 + :domain => 'fogzonestests.com' }.merge!(config[:zone_attributes] || {}) collection_tests(provider[:dns].zones, zone_attributes, config[:mocked])