1 # vim: set encoding=utf-8 et sw=4 sts=4 :
3 from formencode import validators as V
4 from pymin.config import Option
5 from handler import DnsHandler
7 def setup_service(options, config):
8 options.add_group('dns', 'DNS service', [
9 Option('pickle_dir', V.String, metavar='DIR',
10 help='store persistent data in DIR directory'),
11 Option('config_named_dir', V.String, metavar='DIR',
12 help='write named config files in DIR directory'),
13 Option('config_zones_dir', V.String, metavar='DIR',
14 help='write zone config files in DIR directory'),
17 def get_service(config):
18 return DnsHandler(config.dns.pickle_dir, {
19 'named.conf': config.dns.config_named_dir,
20 'zoneX.zone': config.dns.config_zones_dir,