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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a9fa2487b74cb0376bffd685084ba6a2f81b7f27
4
- data.tar.gz: 062731af2976fffd05159bee307449af36515f34
3
+ metadata.gz: d58e753dc0785d8bfaf2f70810c40e181b7a43f8
4
+ data.tar.gz: ce0bdaa0b52b229d6df241a0aa1a37f8c430e3b8
5
5
  SHA512:
6
- metadata.gz: 577fc2deb7721bc47da1f022762cdb0ca058a2e55f189916dec21ef9ef16ed970be4605d4f2dba0fdb4602d6c0382a7613c02f85a110960bcb201d69c2ef4837
7
- data.tar.gz: abdf2c0de8a42c62903414bcae7f01b8e0b95679f019afa98b4c89017b777c25ccac6279a08a9e20e78360ed324274f79c187369ffbca5ff59f556912b90f2ce
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
- records = service.get_record(type, zone.identity, name).body['data']
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
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Dynect
3
- VERSION = '0.0.2'
3
+ VERSION = '0.0.3'
4
4
  end
5
5
  end
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.2
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: 2015-08-24 00:00:00.000000000 Z
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.4.8
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: