Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F1969798
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, May 17, 10:50 AM
Size
1 KB
Mime Type
text/x-diff
Expires
Tue, May 19, 10:50 AM (20 h, 27 m)
Engine
blob
Format
Raw Data
Handle
385258
Attached To
rWEBDNS WebDNS (edet4)
View Options
diff --git a/dnsworker/lib/dnsworker/pushers/webdns.rb b/dnsworker/lib/dnsworker/pushers/webdns.rb
index 5c80a9e..881978f 100644
--- a/dnsworker/lib/dnsworker/pushers/webdns.rb
+++ b/dnsworker/lib/dnsworker/pushers/webdns.rb
@@ -1,23 +1,31 @@
#!/usr/bin/env ruby
require 'json'
require 'rack/utils'
class DNSWorker::Pushers::Webdns < DNSWorker::Pushers::Base
def replace_ds(parent, zone, dss)
query = Rack::Utils.build_nested_query(
child: zone,
parent: parent,
ds: dss,
)
uri = URI(cfg.values_at('webdns_base', 'webdns_replace_ds').join % { query: query })
Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https') do |http|
resp = http.request Net::HTTP::Put.new(uri.request_uri)
- return false if resp.code != '200'
+ if resp.code != '200'
+ $stderr.puts "WebDNS returned #{resp.code}"
+ return false
+ end
+
+ body = JSON.parse(resp.body)
+ return true if body['ok']
+
+ $stderr.puts "WebDNS returned error '#{body['msg']}'"
end
true
end
end
Event Timeline
Log In to Comment