pdns-client 0.2.0 → 0.3.0

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
  SHA256:
3
- metadata.gz: 4ebba94e761d2a3e111ce4112dd909b07f27ca8f584000577fcb94df1b82afce
4
- data.tar.gz: be876ff6db52cfede08c8327b3c6f030297039e6231154a93e0596a2042bdf87
3
+ metadata.gz: accae4e094e892cdd02f716b450fbf04aba9994ea94fdc74ae4da3bba15aea30
4
+ data.tar.gz: b340f3cf526a3d2ae918712732072d67d093ba301c63049fba22de145ec8cafc
5
5
  SHA512:
6
- metadata.gz: bad3ddfef2fdd3ec686225c295e87b6c025907b2fa05f0585493fa9f65d5df1563c1e784b882cd088078eaf3905c1110e399e74080cedb878acb35720e09887a
7
- data.tar.gz: 5fb34d4696ad9142cad80854f057b63f98cc92bf27ee5b2821e8b9dd8429818b30636e1bbc9fffac7e9f608ea3fb75a335cb834f69eb09846038edd93ae2ddfc
6
+ metadata.gz: dac4daa116e91d48857ff499656b305184dd48a92d73b98b6d2be769688ca670373d0c4ff02018e6e6c11f3022c3a261dc158d78bfa25931239f8297be077176
7
+ data.tar.gz: 45e26292617a283887adee9f75c4444828e47b68e7bf48fe3f80973b04faaf9dacdb736aa66c61fbd0330907b92065d7f1f333735f6235a8de6b2bd691a474d5
@@ -1,5 +1,5 @@
1
1
  module Pdns
2
2
  class Client
3
- VERSION = "0.2.0"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  end
data/lib/pdns/client.rb CHANGED
@@ -70,12 +70,17 @@ module Pdns
70
70
  end
71
71
 
72
72
  def upsert_record(zone_name, lvalue, type, rvalues, ttl = 60)
73
+ name = if lvalue.nil? || (lvalue == '')
74
+ "#{zone_name}."
75
+ else
76
+ "#{lvalue}.#{zone_name}."
77
+ end
73
78
  rvalues = [rvalues].flatten
74
79
  unwrap {
75
80
  http.patch(@url + "api/v1/servers/localhost/zones/#{zone_name}", json: {
76
81
  "rrsets": [
77
82
  {
78
- "name": "#{lvalue}.#{zone_name}.",
83
+ "name": name,
79
84
  "type": type,
80
85
  "ttl": ttl,
81
86
  "changetype": "REPLACE",
@@ -83,7 +88,7 @@ module Pdns
83
88
  {
84
89
  "content": rvalue,
85
90
  "disabled": false,
86
- "name": "#{lvalue}.#{zone_name}.",
91
+ "name": name,
87
92
  "type": type,
88
93
  "priority": 0
89
94
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pdns-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sheldon Hearn
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-16 00:00:00.000000000 Z
11
+ date: 2022-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http
@@ -110,8 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
110
  - !ruby/object:Gem::Version
111
111
  version: '0'
112
112
  requirements: []
113
- rubyforge_project:
114
- rubygems_version: 2.7.6
113
+ rubygems_version: 3.0.3
115
114
  signing_key:
116
115
  specification_version: 4
117
116
  summary: DNS API Client