示例#1
0
class OrchestratorException(Exception):
    """Base Orchestrator Exception.

    To correctly use this class, inherit from it and define
    a 'message' property. That message will get printf'd
    with the keyword arguments provided to the constructor.
    """

    message = _("An unknown exception occurred.")

    def __init__(self, **kwargs):
        try:
            super(OrchestratorException, self).__init__(self.message % kwargs)
            self.msg = self.message % kwargs
        except Exception:
            with excutils.save_and_reraise_exception() as ctxt:
                if not self.use_fatal_exceptions():
                    ctxt.reraise = False
                    # at least get the core message out if something happened
                    super(OrchestratorException, self).__init__(self.message)

    if six.PY2:

        def __unicode__(self):
            return unicode(self.msg)

    def use_fatal_exceptions(self):
        return False
示例#2
0
class NotAuthorized(OrchestratorException):
    message = _("Not authorized.")
示例#3
0
class BadRequest(OrchestratorException):
    message = _('Bad %(resource)s request: %(msg)s')
示例#4
0
class CommunityNotFound(NotFound):
    message = _("Community %(community)s not found in region=%(region_name)s")
示例#5
0
class ResourceNotFound(NotFound):
    message = _("Resource not available")
示例#6
0
class CommunityAlreadyExists(Conflict):
    message = _("Community %(community)s in region=%(region_name)s "
                "already exists")
示例#7
0
class ObjectActionError(OrchestratorException):
    msg_fmt = _('Object action %(action)s failed because: %(reason)s')
示例#8
0
class InUse(OrchestratorException):
    message = _("The resource is inuse")
示例#9
0
class OrchRequestNotFound(NotFound):
    message = _("OrchRequest  %(orch_request)s not found")
示例#10
0
class OrchRequestAlreadyExists(Conflict):
    message = _("OrchRequest with orch_request=%(orch_request)s "
                "target_region_name=%(target_region_name)s already exists")
示例#11
0
class OrchJobAlreadyExists(Conflict):
    message = _("OrchJob with resource_id=%(resource_id)s "
                "endpoint_type=%(endpoint_type)s "
                "operation_type=%(operation_type)s already exists")
示例#12
0
class OrchJobNotFound(NotFound):
    message = _("OrchJob  %(orch_job)s not found")
示例#13
0
class SubcloudNotFound(NotFound):
    message = _("Subcloud %(region_name)s not found")
示例#14
0
class ServiceUnavailable(OrchestratorException):
    message = _("The service is unavailable")
示例#15
0
class TrapDestAlreadyExists(Conflict):
    message = _("TrapDest in region=%(region_name)s ip_address=%(ip_address)s "
                "community=%(community)s already exists")
示例#16
0
class AdminRequired(NotAuthorized):
    message = _("User does not have admin privileges: %(reason)s")
示例#17
0
class TrapDestNotFound(NotFound):
    message = _("Trapdest in region=%(region_name)s with ip_address "
                "%(ip_address)s not found")
示例#18
0
class InvalidConfigurationOption(OrchestratorException):
    message = _("An invalid value was provided for %(opt_name)s: "
                "%(opt_value)s")
示例#19
0
class SyncRequestTimeout(OrchestratorException):
    message = _("The sync operation timed out")