Removes the Bind9 zone file.

migration
Philippe PITTOLI 2024-07-02 14:36:49 +02:00
parent 2d64da170e
commit 98b5ed2638
1 changed files with 4 additions and 8 deletions

View File

@ -159,7 +159,7 @@ class DNSManager::Storage
@domains << the_new_domain
# Add the new zone in the database.
zones_by_domain.update_or_create domain, default_zone
update_zone default_zone
Response::DomainAdded.new domain
end
@ -253,10 +253,7 @@ class DNSManager::Storage
domains << Domain.new zone.domain
end
# Add -or replace- the zone.
zones_by_domain.update_or_create zone.domain, zone
generate_bind9_zonefile zone.domain
update_zone zone
Response::Success.new
end
@ -277,8 +274,6 @@ class DNSManager::Storage
update_zone zone
generate_bind9_zonefile zone.domain
Response::RRAdded.new zone.domain, rr
end
@ -334,9 +329,10 @@ class DNSManager::Storage
Response::RRDeleted.new rrid
end
# TODO: removes a Bind9 zonefile.
# Removes a Bind9 zonefile.
def remove_bind9_zonefile(domain : String) : Nil
Baguette::Log.info "Removing a Bind9 zone file."
File.delete "#{@zonefiledir}/#{domain}"
end
# Deletes a domain.