X-Git-Url: https://git.llucax.com/software/pymin.git/blobdiff_plain/f79fe24d7dae27f6cb31745f24256b01755aad8d..05968c86ff71ae5031fd5940cf4807a4b8e71e24:/services/dns/zone.py?ds=inline diff --git a/services/dns/zone.py b/services/dns/zone.py index f91fcc7..2e33382 100644 --- a/services/dns/zone.py +++ b/services/dns/zone.py @@ -1,24 +1,23 @@ # vim: set encoding=utf-8 et sw=4 sts=4 : -# TODO documentation, validation +# TODO documentation -from pymin.seqtools import Sequence +from pymin.validation import Item, Field, FullyQualifiedHostName from pymin.service.util import DictSubHandler __all__ = ('DnsHandler',) -class Zone(Sequence): - def __init__(self, name): - self.name = name +class Zone(Item): + name = Field(FullyQualifiedHostName(not_empty=True)) + def __init__(self, *args, **kwargs): + Item.__init__(self, *args, **kwargs) self.hosts = dict() self.mxs = dict() self.nss = dict() self._add = False self._update = False self._delete = False - def as_tuple(self): - return (self.name, self.hosts, self.mxs, self.nss) class ZoneHandler(DictSubHandler): handler_help = u"Manage DNS zones"