X-Git-Url: https://git.llucax.com/software/pymin.git/blobdiff_plain/9c40f2f2d207eac67ca6add337ab5808deedea84..892ae599bab9c942d7b8aaa0530c3b52841a3a29:/services/dhcp/__init__.py diff --git a/services/dhcp/__init__.py b/services/dhcp/__init__.py index 5734c2f..b728162 100644 --- a/services/dhcp/__init__.py +++ b/services/dhcp/__init__.py @@ -8,11 +8,17 @@ try: except ImportError: import pickle -import seqtools try: - from dispatcher import handler + from seqtools import Sequence except ImportError: - def handler(f): return f # NOP for testing + # NOP for testing + class Sequence: pass +try: + from dispatcher import handler, HandlerError +except ImportError: + # NOP for testing + class HandlerError(RuntimeError): pass + def handler(f): return f __ALL__ = ('DhcpHandler',) @@ -24,7 +30,7 @@ config_filename = 'dhcpd.conf' template_dir = path.join(path.dirname(__file__), 'templates') -class Error(RuntimeError): +class Error(HandlerError): r""" Error(command) -> Error instance :: Base DhcpHandler exception class. @@ -99,7 +105,7 @@ class ParameterNotFoundError(ParameterError): self.message = 'Parameter not found: "%s"' % paramname -class Host(seqtools.Sequence): +class Host(Sequence): r"""Host(name, ip, mac) -> Host instance :: Class representing a host. name - Host name, should be a fully qualified name, but no checks are done.