1 # Copyright 2015 OpenStack LLC.
4 # Licensed under the Apache License, Version 2.0 (the "License"); you may
5 # not use this file except in compliance with the License. You may obtain
6 # a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 # License for the specific language governing permissions and limitations
16 from neutron._i18n import _
17 from neutron.common import exceptions
20 class InvalidSubnetRequestType(exceptions.BadRequest):
21 message = _("Cannot handle subnet of type %(subnet_type)s")
24 class AddressCalculationFailure(exceptions.NeutronException):
25 message = _("Unable to calculate %(address_type)s address because of:"
29 class InvalidAddressType(exceptions.NeutronException):
30 message = _("Unknown address type %(address_type)s")
33 class IpAddressAllocationNotFound(exceptions.NeutronException):
34 message = _("Unable to find IP address %(ip_address)s on subnet "
38 class IpAddressAlreadyAllocated(exceptions.Conflict):
39 message = _("IP address %(ip)s already allocated in subnet %(subnet_id)s")
42 class InvalidIpForSubnet(exceptions.BadRequest):
43 message = _("IP address %(ip)s does not belong to subnet %(subnet_id)s")
46 class InvalidAddressRequest(exceptions.BadRequest):
47 message = _("The address allocation request could not be satisfied "
48 "because: %(reason)s")
51 class InvalidSubnetRequest(exceptions.BadRequest):
52 message = _("The subnet request could not be satisfied because: "
56 class AllocationOnAutoAddressSubnet(exceptions.NeutronException):
57 message = _("IPv6 address %(ip)s cannot be directly "
58 "assigned to a port on subnet %(subnet_id)s as the "
59 "subnet is configured for automatic addresses")
62 class IpAddressGenerationFailure(exceptions.Conflict):
63 message = _("No more IP addresses available for subnet %(subnet_id)s.")
66 class IPAllocationFailed(exceptions.NeutronException):
67 message = _("IP allocation failed. Try again later.")
70 class IpamAvailabilityRangeNoChanges(exceptions.NeutronException):
71 message = _("New value for first_ip or last_ip has to be specified.")