Project

General

Profile

« Previous | Next » 

Revision fba691ae

Added by Marc Dequènes almost 16 years ago

  • ID fba691ae268e2d90b38db4a6ee6587e6c75d8505

[evol] backup zone before replacing, reload zone, and rollback zone if reload failed

View differences:

postman
require 'cyborghood/mail'
require 'cyborghood/objects'
require 'cyborghood/services/dns'
require 'fileutils'
#Socket.gethostname
......
if current_serial.nil? or result.serial > current_serial
begin
srv_dns.write_zone_from_file(f.path)
f.close!
logger.info "zone changed"
if srv_dns.reload_zone
logger.info "zone reloaded"
else
logger.info "zone reload failed, replacing old content"
srv_dns.replace_zone_with_backup
result.message = "Internal error."
return result
end
rescue
logger.debug "Writing zone file failed"
raise

Also available in: Unified diff