- TransactionalHandler, ParametersHandler, call
-
-__ALL__ = ('DnsHandler', 'Error',
- 'ZoneError', 'ZoneNotFoundError', 'ZoneAlreadyExistsError',
- 'HostError', 'HostAlreadyExistsError', 'HostNotFoundError',
- 'MailExchangeError', 'MailExchangeAlreadyExistsError',
- 'MailExchangeNotFoundError', 'NameServerError',
- 'NameServerAlreadyExistsError', 'NameServerNotFoundError')
-
-template_dir = path.join(path.dirname(__file__), 'templates')
-
-
-class Error(HandlerError):
- r"""
- Error(command) -> Error instance :: Base DnsHandler exception class.
-
- All exceptions raised by the DnsHandler inherits from this one, so you can
- easily catch any DnsHandler 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(zonename) -> 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(hostname) -> ZoneNotFoundError instance
-
- This exception is raised when trying to operate on a zone that doesn't
- exists.
- """
-
- def __init__(self, zonename):
- r"Initialize the object. See class documentation for more info."
- self.message = 'zone not found: "%s"' % zonename
-
-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"""
- MailExchangeError(hostname) -> MailExchangeError instance
-
- This is the base exception for all mail exchange 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"""
- MailExchangeAlreadyExistsError(hostname) -> MailExchangeAlreadyExistsError instance
-
- This exception is raised when trying to add a mail exchange 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"""
- MailExchangeNotFoundError(hostname) -> MailExchangeNotFoundError instance
-
- This exception is raised when trying to operate on a mail exchange 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"""
- NameServerError(ns) -> NameServerError instance
-
- This is the base exception for all name server 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"""
- NameServerAlreadyExistsError(hostname) -> NameServerAlreadyExistsError instance
-
- This exception is raised when trying to add a name server that already exists.
- """
-
- def __init__(self, ns):
- r"Initialize the object. See class documentation for more info."
- self.message = 'Name server already exists: "%s"' % ns
-
-class NameServerNotFoundError(NameServerError):
- r"""
- NameServerNotFoundError(hostname) -> NameServerNotFoundError instance
-
- This exception is raised when trying to operate on a name server 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