mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[rackspace|dns] creating a record now uses specified ttl
This commit is contained in:
parent
de80a97d7b
commit
0c88e3fe63
3 changed files with 12 additions and 3 deletions
|
@ -51,6 +51,10 @@ module Fog
|
|||
:data => value
|
||||
}
|
||||
|
||||
if ttl
|
||||
options[:ttl] = ttl
|
||||
end
|
||||
|
||||
if priority
|
||||
options[:priority] = priority
|
||||
end
|
||||
|
@ -80,6 +84,7 @@ module Fog
|
|||
options[:type] = type if type
|
||||
options[:data] = value if value
|
||||
options[:priority] = priority if priority
|
||||
options[:ttl] = ttl if ttl
|
||||
|
||||
wait_for_job connection.modify_record(@zone.identity, identity, options).body['jobId']
|
||||
true
|
||||
|
|
|
@ -13,7 +13,11 @@ module Fog
|
|||
'type' => record[:type],
|
||||
'data' => record[:data]
|
||||
}
|
||||
|
||||
|
||||
if record.has_key? :ttl
|
||||
record_data['ttl'] = record[:ttl]
|
||||
end
|
||||
|
||||
if record.has_key? :priority
|
||||
record_data['priority'] = record[:priority]
|
||||
end
|
||||
|
|
|
@ -12,8 +12,8 @@ Shindo.tests('Fog::DNS[:rackspace] | dns records requests', ['rackspace', 'dns']
|
|||
Fog::DNS[:rackspace].list_records(@domain_id).body
|
||||
end
|
||||
|
||||
tests("add_records(#{@domain_id}, [{ :name => 'test1.#{domain_name}', :type => 'A', :data => '192.168.2.1'}])").formats(RECORD_LIST_FORMAT) do
|
||||
response = wait_for Fog::DNS[:rackspace], Fog::DNS[:rackspace].add_records(@domain_id, [{ :name => 'test1.' + domain_name, :type => 'A', :data => '192.168.2.1'}])
|
||||
tests("add_records(#{@domain_id}, [{ :name => 'test1.#{domain_name}', :type => 'A', :data => '192.168.2.1', :ttl => 550}])").formats(RECORD_LIST_FORMAT) do
|
||||
response = wait_for Fog::DNS[:rackspace], Fog::DNS[:rackspace].add_records(@domain_id, [{ :name => 'test1.' + domain_name, :type => 'A', :data => '192.168.2.1', :ttl => 550}])
|
||||
@record_id = response.body['response']['records'].first['id']
|
||||
response.body['response']
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue