| 1 |
# Copyright (C) 2014 eNovance SAS <[email protected]> |
| 2 |
# |
| 3 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 4 |
# not use this file except in compliance with the License. You may obtain |
| 5 |
# a copy of the License at |
| 6 |
# |
| 7 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
# |
| 9 |
# Unless required by applicable law or agreed to in writing, software |
| 10 |
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 |
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 |
# License for the specific language governing permissions and limitations |
| 13 |
# under the License. |
| 14 |
|
| 15 |
from oslo_log import log as logging |
| 16 |
|
| 17 |
from neutron_lib._i18n import _ |
| 18 |
from neutron_lib import exceptions |
| 19 |
|
| 20 |
LOG = logging.getLogger(__name__) |
| 21 |
|
| 22 |
|
| 23 |
class MaxVRIDAllocationTriesReached(exceptions.NeutronException): |
| 24 |
message = _("Failed to allocate a VRID in the network %(network_id)s " |
| 25 |
"for the router %(router_id)s after %(max_tries)s tries.") |
| 26 |
|
| 27 |
|
| 28 |
class NoVRIDAvailable(exceptions.Conflict): |
| 29 |
message = _("No more Virtual Router Identifier (VRID) available when " |
| 30 |
"creating router %(router_id)s. The limit of number " |
| 31 |
"of HA Routers per tenant is 254.") |
| 32 |
|
| 33 |
|
| 34 |
class HANetworkConcurrentDeletion(exceptions.Conflict): |
| 35 |
message = _("Network for project %(project_id)s concurrently deleted.") |
| 36 |
|
| 37 |
|
| 38 |
class HANetworkCIDRNotValid(exceptions.NeutronException): |
| 39 |
message = _("The HA Network CIDR specified in the configuration file " |
| 40 |
"isn't valid; %(cidr)s.") |
| 41 |
|
| 42 |
|
| 43 |
class HAMaximumAgentsNumberNotValid(exceptions.NeutronException): |
| 44 |
message = _("max_l3_agents_per_router %(max_agents)s config parameter " |
| 45 |
"is not valid as it cannot be negative. It must be 1 or " |
| 46 |
"greater. Alternatively, it can be 0 to mean unlimited.") |
| 47 |
|
| 48 |
|
| 49 |
class DuplicatedHANetwork(exceptions.Conflict): |
| 50 |
message = _('Project %(project_id)s already has a HA network.') |