]> git.llucax.com Git - software/pymin.git/blob - services/dns/zone.py
Split dns handler in submodules (refs #2).
[software/pymin.git] / services / dns / zone.py
1 # vim: set encoding=utf-8 et sw=4 sts=4 :
2
3 # TODO documentation, validation
4
5 from pymin.seqtools import Sequence
6 from pymin.service.util import DictSubHandler
7
8 __all__ = ('DnsHandler',)
9
10
11 class Zone(Sequence):
12     def __init__(self, name):
13         self.name = name
14         self.hosts = dict()
15         self.mxs = dict()
16         self.nss = dict()
17         self._add = False
18         self._update = False
19         self._delete = False
20     def as_tuple(self):
21         return (self.name, self.hosts, self.mxs, self.nss)
22
23 class ZoneHandler(DictSubHandler):
24     handler_help = u"Manage DNS zones"
25     _cont_subhandler_attr = 'zones'
26     _cont_subhandler_class = Zone
27