RRAdded response message.
This commit is contained in:
parent
3fcb3a0d64
commit
52e7aea4fa
@ -70,5 +70,13 @@ class DNSManager::Response
|
||||
end
|
||||
end
|
||||
DNSManager.responses << RRDeleted
|
||||
|
||||
IPC::JSON.message RRAdded, 19 do
|
||||
property domain : String
|
||||
property rr : Storage::Zone::ResourceRecord
|
||||
def initialize(@domain, @rr)
|
||||
end
|
||||
end
|
||||
DNSManager.responses << RRAdded
|
||||
end
|
||||
|
||||
|
@ -168,12 +168,14 @@ class DNSManager::Storage
|
||||
end
|
||||
end
|
||||
|
||||
puts "RRID before: #{rr.rrid}"
|
||||
zone << rr
|
||||
puts "RRID after: #{rr.rrid}"
|
||||
|
||||
# Update the zone.
|
||||
zones_by_domain.update_or_create zone.domain, zone
|
||||
|
||||
Response::Success.new
|
||||
Response::RRAdded.new zone.domain, rr
|
||||
rescue e
|
||||
Baguette::Log.error "trying to add a resource record in domain #{domain}: #{e}"
|
||||
Response::Error.new "error while adding a resource record in domain #{domain}"
|
||||
|
Loading…
Reference in New Issue
Block a user