mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Add TTL on save rather than initialize.
Move the TTL default assignment to the #save method instead of applying it on object initialization.
This commit is contained in:
parent
ef3bec5ade
commit
226a935fba
12 changed files with 9 additions and 15 deletions
|
@ -23,7 +23,6 @@ module Fog
|
|||
attribute :set_identifier,:aliases => ['SetIdentifier']
|
||||
|
||||
def initialize(attributes={})
|
||||
self.ttl ||= 3600
|
||||
super
|
||||
end
|
||||
|
||||
|
@ -38,6 +37,7 @@ module Fog
|
|||
end
|
||||
|
||||
def save
|
||||
self.ttl ||= 3600
|
||||
options = attributes_to_options('CREATE')
|
||||
data = service.change_resource_record_sets(zone.id, [options]).body
|
||||
merge_attributes(data)
|
||||
|
|
|
@ -19,7 +19,6 @@ module Fog
|
|||
attribute :minimum
|
||||
|
||||
def initialize(attributes = {})
|
||||
self.ttl ||= 3600
|
||||
super(attributes)
|
||||
end
|
||||
|
||||
|
@ -51,6 +50,7 @@ module Fog
|
|||
end
|
||||
|
||||
def save
|
||||
self.ttl ||= 3600
|
||||
requires :domain, :ttl
|
||||
options = attributes.dup
|
||||
options[:name] = options.delete(:domain)
|
||||
|
|
|
@ -21,7 +21,6 @@ module Fog
|
|||
attribute :priority, :aliases => "prio"
|
||||
|
||||
def initialize(attributes={})
|
||||
self.ttl ||= 3600
|
||||
super
|
||||
end
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@ module Fog
|
|||
attribute :value, :aliases => "data"
|
||||
|
||||
def initialize(attributes={})
|
||||
self.ttl ||= 1800
|
||||
super
|
||||
end
|
||||
|
||||
|
@ -39,6 +38,7 @@ module Fog
|
|||
end
|
||||
|
||||
def save
|
||||
self.ttl ||= 1800
|
||||
requires :name, :type, :value, :ttl
|
||||
options = {}
|
||||
options[:ttl] = ttl if ttl
|
||||
|
|
|
@ -17,7 +17,6 @@ module Fog
|
|||
attribute :type, :aliases => 'zone_type'
|
||||
|
||||
def initialize(attributes={})
|
||||
self.ttl ||= 3600
|
||||
super
|
||||
end
|
||||
|
||||
|
@ -47,6 +46,7 @@ module Fog
|
|||
end
|
||||
|
||||
def save
|
||||
self.ttl ||= 3600
|
||||
requires :domain, :email, :ttl
|
||||
data = service.post_zone(email, ttl, domain).body['data']
|
||||
merge_attributes(data)
|
||||
|
|
|
@ -23,7 +23,6 @@ module Fog
|
|||
# "PORT":0,
|
||||
|
||||
def initialize(attributes={})
|
||||
self.ttl ||= 3600
|
||||
super
|
||||
end
|
||||
|
||||
|
|
|
@ -24,7 +24,6 @@ module Fog
|
|||
|
||||
def initialize(attributes={})
|
||||
self.type ||= 'master'
|
||||
self.ttl ||= 3600
|
||||
super
|
||||
end
|
||||
|
||||
|
|
|
@ -56,6 +56,7 @@ module Fog
|
|||
end
|
||||
|
||||
def save
|
||||
self.ttl ||= 3600
|
||||
requires :domain, :type, :ttl
|
||||
options = {}
|
||||
# * options<~Hash> - optional paramaters
|
||||
|
|
|
@ -27,8 +27,7 @@ for provider, config in dns_providers
|
|||
|
||||
if !Fog.mocking? || config[:mocked]
|
||||
zone_attributes = {
|
||||
:domain => domain_name,
|
||||
:ttl => 3600
|
||||
:domain => domain_name
|
||||
}.merge(config[:zone_attributes] || {})
|
||||
|
||||
@zone = Fog::DNS[provider].zones.create(zone_attributes)
|
||||
|
|
|
@ -15,8 +15,7 @@ for provider, config in dns_providers
|
|||
|
||||
if !Fog.mocking? || config[:mocked]
|
||||
zone_attributes = {
|
||||
:domain => domain_name,
|
||||
:ttl => 3600
|
||||
:domain => domain_name
|
||||
}.merge(config[:zone_attributes] || {})
|
||||
|
||||
@zone = Fog::DNS[provider].zones.create(zone_attributes)
|
||||
|
|
|
@ -8,8 +8,7 @@ for provider, config in dns_providers
|
|||
Shindo.tests("Fog::DNS[:#{provider}] | zone", [provider.to_s]) do
|
||||
|
||||
zone_attributes = {
|
||||
:domain => domain_name,
|
||||
:ttl => 3600
|
||||
:domain => domain_name
|
||||
}.merge!(config[:zone_attributes] || {})
|
||||
|
||||
model_tests(Fog::DNS[provider].zones, zone_attributes, config[:mocked])
|
||||
|
|
|
@ -8,8 +8,7 @@ for provider, config in dns_providers
|
|||
Shindo.tests("Fog::DNS[:#{provider}] | zones", [provider.to_s]) do
|
||||
|
||||
zone_attributes = {
|
||||
:domain => domain_name,
|
||||
:ttl => 3600
|
||||
:domain => domain_name
|
||||
}.merge!(config[:zone_attributes] || {})
|
||||
|
||||
collection_tests(Fog::DNS[provider].zones, zone_attributes, config[:mocked])
|
||||
|
|
Loading…
Reference in a new issue