[Zerigo|DNS] Remove default 3600 TTL

Zerigo records and zones were setting a TTL of 3600 on the model if no
TTL was set in the response. On first glance this seems like A Good
Thing - yes we want a default TTL! However, it masks the fact that a
record might have no TTL set on it and is using the default TTL from the
zone. If you're trying to use the model to determine if the TTL is set
to some value (say 3600), but the value defaults to 3600 if it isn't
set, then you have no way of knowing if it's right or not.

This change forces you to set a TTL if you're performing an operation
that requires one (#save).
This commit is contained in:
Eric Hankins 2013-05-10 11:14:54 -05:00
parent 55c720ba9f
commit ef3bec5ade
6 changed files with 8 additions and 6 deletions

View File

@ -23,7 +23,6 @@ module Fog
attribute :zone_id, :aliases => 'zone-id'
def initialize(attributes={})
self.ttl ||= 3600
super
end

View File

@ -27,7 +27,6 @@ module Fog
def initialize(attributes={})
self.type ||= 'pri_sec'
self.ttl ||= 3600
super
end

View File

@ -27,7 +27,8 @@ for provider, config in dns_providers
if !Fog.mocking? || config[:mocked]
zone_attributes = {
:domain => domain_name
:domain => domain_name,
:ttl => 3600
}.merge(config[:zone_attributes] || {})
@zone = Fog::DNS[provider].zones.create(zone_attributes)

View File

@ -15,7 +15,8 @@ for provider, config in dns_providers
if !Fog.mocking? || config[:mocked]
zone_attributes = {
:domain => domain_name
:domain => domain_name,
:ttl => 3600
}.merge(config[:zone_attributes] || {})
@zone = Fog::DNS[provider].zones.create(zone_attributes)

View File

@ -8,7 +8,8 @@ for provider, config in dns_providers
Shindo.tests("Fog::DNS[:#{provider}] | zone", [provider.to_s]) do
zone_attributes = {
:domain => domain_name
:domain => domain_name,
:ttl => 3600
}.merge!(config[:zone_attributes] || {})
model_tests(Fog::DNS[provider].zones, zone_attributes, config[:mocked])

View File

@ -8,7 +8,8 @@ for provider, config in dns_providers
Shindo.tests("Fog::DNS[:#{provider}] | zones", [provider.to_s]) do
zone_attributes = {
:domain => domain_name
:domain => domain_name,
:ttl => 3600
}.merge!(config[:zone_attributes] || {})
collection_tests(Fog::DNS[provider].zones, zone_attributes, config[:mocked])