]> git.llucax.com Git - software/pymin.git/blob - services/dns/mx.py
Add validation to DnsHandler (refs #20)
[software/pymin.git] / services / dns / mx.py
1 # vim: set encoding=utf-8 et sw=4 sts=4 :
2
3 # TODO documentation
4
5 from pymin.validation import Item, Field, FullyQualifiedHostName, UInt16
6 from pymin.service.util import DictComposedSubHandler
7
8 __all__ = ('MailExchangeHandler',)
9
10
11 class MailExchange(Item):
12     mx = Field(FullyQualifiedHostName(not_empty=True))
13     prio = Field(UInt16(not_empty=True))
14
15 class MailExchangeHandler(DictComposedSubHandler):
16     handler_help = u"Manage DNS mail exchangers (MX)"
17     _comp_subhandler_cont = 'zones'
18     _comp_subhandler_attr = 'mxs'
19     _comp_subhandler_class = MailExchange
20