-template_dir = path.join(path.dirname(__file__), 'templates')
-
-
-class Error(RuntimeError):
- r"""
- Error(command) -> Error instance :: Base DhcpHandler exception class.
-
- All exceptions raised by the DhcpHandler inherits from this one, so you can
- easily catch any DhcpHandler exception.
-
- message - A descriptive error message.
- """
-
- def __init__(self, message):
- r"Initialize the Error object. See class documentation for more info."
- self.message = message
-
- def __str__(self):
- return self.message
-
-class ZoneError(Error, KeyError):
- r"""
- ZoneError(hostname) -> ZoneError instance
-
- This is the base exception for all zone related errors.
- """
-
- def __init__(self, zonename):
- r"Initialize the object. See class documentation for more info."
- self.message = 'Zone error: "%s"' % zonename
-
-
-class ZoneNotFoundError(ZoneError):
- r"""
- ZoneNotFoundError(zonename) -> ZoneNotFoundError instance
-
- This exception is raised when trying to operate on a zonename that doesn't
- exists.
- """
-
- def __init__(self, hostname):
- r"Initialize the object. See class documentation for more info."
- self.message = 'zone not found: "%s"' % hostname
-
-
-class ZoneAlreadyExistsError(ZoneError):
- r"""
- ZoneAlreadyExistsError(hostname) -> ZoneAlreadyExistsError instance
-
- This exception is raised when trying to add a zonename that already exists.
- """
-
- def __init__(self, zonename):
- r"Initialize the object. See class documentation for more info."
- self.message = 'Zone already exists: "%s"' % zonename
-
-
-class HostError(Error, KeyError):
- r"""
- HostError(hostname) -> HostError instance
-
- This is the base exception for all host related errors.
- """
-
- def __init__(self, hostname):
- r"Initialize the object. See class documentation for more info."
- self.message = 'Host error: "%s"' % hostname
-
-class HostAlreadyExistsError(HostError):
- r"""
- HostAlreadyExistsError(hostname) -> HostAlreadyExistsError instance
-
- This exception is raised when trying to add a hostname that already exists.
- """
-
- def __init__(self, hostname):
- r"Initialize the object. See class documentation for more info."
- self.message = 'Host already exists: "%s"' % hostname
-
-class HostNotFoundError(HostError):
- r"""
- HostNotFoundError(hostname) -> HostNotFoundError instance
-
- This exception is raised when trying to operate on a hostname that doesn't
- exists.
- """
-
- def __init__(self, hostname):
- r"Initialize the object. See class documentation for more info."
- self.message = 'Host not found: "%s"' % hostname
-
-
-class MailExchangeError(Error, KeyError):
- r"""
- HostError(hostname) -> HostError instance
-
- This is the base exception for all host related errors.
- """
-
- def __init__(self, mx):
- r"Initialize the object. See class documentation for more info."
- self.message = 'Mail Exchange error: "%s"' % mx
-
-class MailExchangeAlreadyExistsError(MailExchangeError):
- r"""
- HostAlreadyExistsError(hostname) -> HostAlreadyExistsError instance
-
- This exception is raised when trying to add a hostname that already exists.
- """
-
- def __init__(self, mx):
- r"Initialize the object. See class documentation for more info."
- self.message = 'Mail Exchange already exists: "%s"' % mx
-
-class MailExchangeNotFoundError(MailExchangeError):
- r"""
- HostNotFoundError(hostname) -> HostNotFoundError instance
-
- This exception is raised when trying to operate on a hostname that doesn't
- exists.
- """
-
- def __init__(self, mx):
- r"Initialize the object. See class documentation for more info."
- self.message = 'Mail Exchange not found: "%s"' % mx
-
-
-
-class NameServerError(Error, KeyError):
- r"""
- HostError(hostname) -> HostError instance
-
- This is the base exception for all host related errors.
- """
-
- def __init__(self, ns):
- r"Initialize the object. See class documentation for more info."
- self.message = 'Name Server error: "%s"' % ns
-
-class NameServerAlreadyExistsError(NameServerError):
- r"""
- HostAlreadyExistsError(hostname) -> HostAlreadyExistsError instance
-
- This exception is raised when trying to add a hostname that already exists.
- """
-
- def __init__(self, ns):
- r"Initialize the object. See class documentation for more info."
- self.message = 'Mail Exchange already exists: "%s"' % ns
-
-class NameServerNotFoundError(NameServerError):
- r"""
- HostNotFoundError(hostname) -> HostNotFoundError instance
-
- This exception is raised when trying to operate on a hostname that doesn't
- exists.
- """
-
- def __init__(self, ns):
- r"Initialize the object. See class documentation for more info."
- self.message = 'Mail Exchange not found: "%s"' % ns
-
-
-class ParameterError(Error, KeyError):
- r"""
- ParameterError(paramname) -> ParameterError instance
-
- This is the base exception for all DhcpHandler parameters related errors.
- """
-
- def __init__(self, paramname):
- r"Initialize the object. See class documentation for more info."
- self.message = 'Parameter error: "%s"' % paramname
-
-class ParameterNotFoundError(ParameterError):
- r"""
- ParameterNotFoundError(hostname) -> ParameterNotFoundError instance
-
- This exception is raised when trying to operate on a parameter that doesn't
- exists.
- """
-
- def __init__(self, paramname):
- r"Initialize the object. See class documentation for more info."
- self.message = 'Parameter not found: "%s"' % paramname
-
-class Host: