mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[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:
parent
55c720ba9f
commit
ef3bec5ade
6 changed files with 8 additions and 6 deletions
|
@ -23,7 +23,6 @@ module Fog
|
|||
attribute :zone_id, :aliases => 'zone-id'
|
||||
|
||||
def initialize(attributes={})
|
||||
self.ttl ||= 3600
|
||||
super
|
||||
end
|
||||
|
||||
|
|
|
@ -27,7 +27,6 @@ module Fog
|
|||
|
||||
def initialize(attributes={})
|
||||
self.type ||= 'pri_sec'
|
||||
self.ttl ||= 3600
|
||||
super
|
||||
end
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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])
|
||||
|
|
|
@ -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])
|
||||
|
|
Loading…
Add table
Reference in a new issue