slap: update interface.

parent de5e16b9
......@@ -35,6 +35,12 @@ class IException(Interface):
Classes which implement IException are used to report errors.
"""
class IConnectionError(IException):
"""
Classes which implement IServerError are used to report a connection problem
to the slap server.
"""
class IServerError(IException):
"""
Classes which implement IServerError are used to report unexpected error
......@@ -164,6 +170,12 @@ class ISoftwareProductCollection(Interface):
software_product, by querying SlapOS Master.
"""
class ISoftwareInstance(Interface):
"""
Classes which implement ISoftwareRelease are used by slap to represent
informations about a Software Instance.
"""
class IComputerPartition(IBuildoutController, IRequester):
"""
Computer Partition interface specification
......@@ -306,7 +318,7 @@ class IComputerPartition(IBuildoutController, IRequester):
def getStatus():
"""
Returns a dictionnary containing the latest status of the
Returns a dictionnary containing the latest status of the
computer partition.
The dictionnary keys are:
user -- user who reported the latest status
......@@ -367,7 +379,7 @@ class IComputer(Interface):
def getStatus():
"""
Returns a dictionnary containing the latest status of the
Returns a dictionnary containing the latest status of the
computer.
The dictionnary keys are:
user -- user who reported the latest status
......@@ -377,7 +389,7 @@ class IComputer(Interface):
def generateCertificate():
"""
Returns a dictionnary containing the new certificate files for
Returns a dictionnary containing the new certificate files for
the computer.
The dictionnary keys are:
key -- key file
......
......@@ -60,15 +60,6 @@ fallback_logger.addHandler(fallback_handler)
DEFAULT_SOFTWARE_TYPE = 'RootSoftwareInstance'
class AuthenticationError(Exception):
pass
class ConnectionError(Exception):
pass
class SlapDocument:
def __init__(self, connection_helper=None):
if connection_helper is not None:
......@@ -197,6 +188,7 @@ class SoftwareInstance(SlapDocument):
"""
Contains Software Instance information
"""
zope.interface.implements(interface.ISoftwareInstance)
def __init__(self, **kwargs):
"""
......@@ -207,20 +199,22 @@ class SoftwareInstance(SlapDocument):
"""Exposed exceptions"""
# XXX Why do we need to expose exceptions?
class ResourceNotReady(Exception):
zope.interface.implements(interface.IResourceNotReady)
class ServerError(Exception):
zope.interface.implements(interface.IServerError)
class NotFoundError(Exception):
zope.interface.implements(interface.INotFoundError)
class AuthenticationError(Exception):
pass
class ConnectionError(Exception):
zope.interface.implements(interface.IConnectionError)
class Supply(SlapDocument):
zope.interface.implements(interface.ISupply)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment