1 # vim: set encoding=utf-8 et sw=4 sts=4 :
4 import logging ; log = logging.getLogger('pymin.services.dhcp')
6 from pymin.seqtools import Sequence
7 from pymin.service.util import DictSubHandler
9 __all__ = ('HostHandler',)
13 r"""Host(name, ip, mac) -> Host instance :: Class representing a host.
15 name - Host name, should be a fully qualified name, but no checks are done.
16 ip - IP assigned to the hostname.
17 mac - MAC address to associate to the hostname.
20 def __init__(self, name, ip, mac):
21 r"Initialize Host object, see class documentation for details."
27 r"Return a tuple representing the host."
28 return (self.name, self.ip, self.mac)
30 def update(self, ip=None, mac=None):
36 class HostHandler(DictSubHandler):
37 r"""HostHandler(parent) -> HostHandler instance :: Handle a list of hosts.
39 This class is a helper for DhcpHandler to do all the work related to hosts
43 handler_help = u"Manage DHCP hosts"
45 _cont_subhandler_attr = 'hosts'
46 _cont_subhandler_class = Host