fog-dynect 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fog/dynect/models/dns/record.rb +23 -12
- data/lib/fog/dynect/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d58e753dc0785d8bfaf2f70810c40e181b7a43f8
|
4
|
+
data.tar.gz: ce0bdaa0b52b229d6df241a0aa1a37f8c430e3b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96ff061abe0c12afd440036deb8aecbbaaa0a4b7635a7eb1977f69f492f76b8f9cc36a84c0cb6bf1721c977492bbbdd8bfd0e29c66975570acfbc75d1ce12207
|
7
|
+
data.tar.gz: 8a9dbb5ac1e27e78be4df16a4a15ffd5895501b76a074592f418b5863369d37eb02803cfbf95dcf8463dae0c86f561099330237ce23c4b8154edeba4a10c50e8
|
@@ -25,7 +25,9 @@ module Fog
|
|
25
25
|
}
|
26
26
|
options.delete_if {|key, value| value.nil?}
|
27
27
|
|
28
|
-
if replace
|
28
|
+
refresh_id if replace && identity.nil?
|
29
|
+
if replace && !identity.nil?
|
30
|
+
options['record_id'] = identity
|
29
31
|
data = service.put_record(type, zone.identity, name, rdata, options).body['data']
|
30
32
|
else
|
31
33
|
data = service.post_record(type, zone.identity, name, rdata, options).body['data']
|
@@ -35,17 +37,7 @@ module Fog
|
|
35
37
|
merge_attributes(data)
|
36
38
|
|
37
39
|
zone.publish
|
38
|
-
|
39
|
-
# data in format ['/REST/xRecord/domain/fqdn/identity]
|
40
|
-
records.map! do |record|
|
41
|
-
tokens = record.split('/')
|
42
|
-
{
|
43
|
-
:identity => tokens.last,
|
44
|
-
:type => tokens[2][0...-6] # everything before 'Record'
|
45
|
-
}
|
46
|
-
end
|
47
|
-
record = records.find {|record| record[:type] == type}
|
48
|
-
merge_attributes(record)
|
40
|
+
refresh_id
|
49
41
|
|
50
42
|
true
|
51
43
|
end
|
@@ -59,6 +51,25 @@ module Fog
|
|
59
51
|
def zone=(new_zone)
|
60
52
|
@zone = new_zone
|
61
53
|
end
|
54
|
+
|
55
|
+
def refresh_id
|
56
|
+
begin
|
57
|
+
records = service.get_record(type, zone.identity, name).body['data']
|
58
|
+
rescue
|
59
|
+
return
|
60
|
+
end
|
61
|
+
# data in format ['/REST/xRecord/domain/fqdn/identity]
|
62
|
+
records.map! do |record|
|
63
|
+
tokens = record.split('/')
|
64
|
+
{
|
65
|
+
:identity => tokens.last,
|
66
|
+
:type => tokens[2][0...-6] # everything before 'Record'
|
67
|
+
}
|
68
|
+
end
|
69
|
+
record = records.find() {|record| record[:type] == type}
|
70
|
+
merge_attributes(record)
|
71
|
+
end
|
72
|
+
|
62
73
|
end
|
63
74
|
end
|
64
75
|
end
|
data/lib/fog/dynect/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fog-dynect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wesley Beary
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-03-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -161,8 +161,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
161
161
|
version: '0'
|
162
162
|
requirements: []
|
163
163
|
rubyforge_project:
|
164
|
-
rubygems_version: 2.
|
164
|
+
rubygems_version: 2.5.1
|
165
165
|
signing_key:
|
166
166
|
specification_version: 4
|
167
167
|
summary: Module for the 'fog' gem to support Dynect DNS.
|
168
168
|
test_files: []
|
169
|
+
has_rdoc:
|