cloudflare-dns-update 2.1.1 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cloudflare/dns/update/command.rb +17 -15
- data/lib/cloudflare/dns/update/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 076e72b5373e7244852b4dfc4df13385aaf6694a
|
4
|
+
data.tar.gz: d68ca108a1d34ab03cc766060834dc6fed7dc558
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca464b63e21f59c148334cd2a5dbdf43f34a7307022c1265423764606ff799b91b9c6759cb90eecfdfd99ed373f8e2c7d6cec5049910914e6bc012d5e5349cfc
|
7
|
+
data.tar.gz: c0e72350e25a19662473641249ca5633268bdb99157d1cb98da4f51871869936676d83e483a23968da19c91a4d9053fb404c291719d559969ad1769fc8b9222e
|
@@ -126,22 +126,24 @@ module Cloudflare::DNS::Update
|
|
126
126
|
end
|
127
127
|
end
|
128
128
|
|
129
|
-
def update_domains
|
129
|
+
def update_domains(content = nil)
|
130
130
|
configuration_store.transaction do |configuration|
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
131
|
+
unless content
|
132
|
+
logger.debug "Executing content command: #{configuration[:content_command]}"
|
133
|
+
content, status = Open3.capture2(configuration[:content_command])
|
134
|
+
|
135
|
+
unless status.success?
|
136
|
+
raise RuntimeError.new("Content command failed with non-zero output: #{status}")
|
137
|
+
end
|
138
|
+
|
139
|
+
unless zone = @connection.zones.find_by_id(configuration[:zone][:id])
|
140
|
+
raise RuntimeError.new("Couldn't load zone #{configuration[:zone].inspect} from API!")
|
141
|
+
end
|
142
|
+
|
143
|
+
# Make sure there is no trailing space:
|
144
|
+
content.chomp!
|
140
145
|
end
|
141
146
|
|
142
|
-
# Make sure there is no trailing space:
|
143
|
-
content.chomp!
|
144
|
-
|
145
147
|
if content != configuration[:content] || @options[:force]
|
146
148
|
logger.info "Content changed #{content.inspect}, updating records..."
|
147
149
|
|
@@ -169,9 +171,9 @@ module Cloudflare::DNS::Update
|
|
169
171
|
else
|
170
172
|
logger.debug "Content hasn't changed."
|
171
173
|
end
|
172
|
-
|
173
|
-
return content
|
174
174
|
end
|
175
|
+
|
176
|
+
return content
|
175
177
|
end
|
176
178
|
|
177
179
|
def invoke(program_name: File.basename($0))
|