1
# Copyright 2012 VMware, Inc
5
# Licensed under the Apache License, Version 2.0 (the "License"); you may
6
# not use this file except in compliance with the License. You may obtain
7
# a copy of the License at
9
# http://www.apache.org/licenses/LICENSE-2.0
11
# Unless required by applicable law or agreed to in writing, software
12
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
# License for the specific language governing permissions and limitations
17
from neutron.common import exceptions as n_exc
20
class NsxPluginException(n_exc.NeutronException):
21
message = _("An unexpected error occurred in the NSX Plugin: %(err_msg)s")
24
class InvalidVersion(NsxPluginException):
25
message = _("Unable to fulfill request with version %(version)s.")
28
class InvalidConnection(NsxPluginException):
29
message = _("Invalid NSX connection parameters: %(conn_params)s")
32
class InvalidClusterConfiguration(NsxPluginException):
33
message = _("Invalid cluster values: %(invalid_attrs)s. Please ensure "
34
"that these values are specified in the [DEFAULT] "
35
"section of the NSX plugin ini file.")
38
class InvalidNovaZone(NsxPluginException):
39
message = _("Unable to find cluster config entry "
40
"for nova zone: %(nova_zone)s")
43
class NoMorePortsException(NsxPluginException):
44
message = _("Unable to create port on network %(network)s. "
45
"Maximum number of ports reached")
48
class NatRuleMismatch(NsxPluginException):
49
message = _("While retrieving NAT rules, %(actual_rules)s were found "
50
"whereas rules in the (%(min_rules)s,%(max_rules)s) interval "
54
class InvalidAttachmentType(NsxPluginException):
55
message = _("Invalid NSX attachment type '%(attachment_type)s'")
58
class MaintenanceInProgress(NsxPluginException):
59
message = _("The networking backend is currently in maintenance mode and "
60
"therefore unable to accept requests which modify its state. "
64
class L2GatewayAlreadyInUse(n_exc.Conflict):
65
message = _("Gateway Service %(gateway)s is already in use")
68
class InvalidSecurityCertificate(NsxPluginException):
69
message = _("An invalid security certificate was specified for the "
70
"gateway device. Certificates must be enclosed between "
71
"'-----BEGIN CERTIFICATE-----' and "
72
"'-----END CERTIFICATE-----'")
75
class ServiceOverQuota(n_exc.Conflict):
76
message = _("Quota exceeded for Vcns resource: %(overs)s: %(err_msg)s")
79
class ServiceClusterUnavailable(NsxPluginException):
80
message = _("Service cluster: '%(cluster_id)s' is unavailable. Please, "
81
"check NSX setup and/or configuration")
84
class PortConfigurationError(NsxPluginException):
85
message = _("An error occurred while connecting LSN %(lsn_id)s "
86
"and network %(net_id)s via port %(port_id)s")
88
def __init__(self, **kwargs):
89
super(PortConfigurationError, self).__init__(**kwargs)
90
self.port_id = kwargs.get('port_id')
93
class LsnNotFound(n_exc.NotFound):
94
message = _('Unable to find LSN for %(entity)s %(entity_id)s')
97
class LsnPortNotFound(n_exc.NotFound):
98
message = (_('Unable to find port for LSN %(lsn_id)s '
99
'and %(entity)s %(entity_id)s'))
102
class LsnMigrationConflict(n_exc.Conflict):
103
message = _("Unable to migrate network '%(net_id)s' to LSN: %(reason)s")
106
class LsnConfigurationConflict(NsxPluginException):
107
message = _("Configuration conflict on Logical Service Node %(lsn_id)s")