Project

General

Profile

Download (664 Bytes) Statistics
| Branch: | Tag: | Revision:
module CyborgHood
module Services
class DNS
def initialize(zone)
@zone = zone

@config = Config.instance
end

def read_zone
file = @config.dns.master_zone_pattern.gsub("#ZONE#", @zone)
# TODO: should be checked at startup time
raise CyberError.new(:unrecoverable, "services/dns", "erroneous configuration: pattern is constant") if file == @config.dns.master_zone_pattern
begin
File.read(file)
rescue
raise CyberError.new(:unrecoverable, "services/dns", "zone '#{@zone}' cannot be read (nonexistent or lack of permission)")
end
end
end
end
end
    (1-1/1)