Set lock_path correctly.
[openstack-build/neutron-build.git] / neutron / ipam / exceptions.py
1 # Copyright 2015 OpenStack LLC.
2 # All Rights Reserved.
3 #
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
7 #
8 #         http://www.apache.org/licenses/LICENSE-2.0
9 #
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
14 #    under the License.
15
16 from neutron._i18n import _
17 from neutron.common import exceptions
18
19
20 class InvalidSubnetRequestType(exceptions.BadRequest):
21     message = _("Cannot handle subnet of type %(subnet_type)s")
22
23
24 class AddressCalculationFailure(exceptions.NeutronException):
25     message = _("Unable to calculate %(address_type)s address because of:"
26                 "%(reason)s")
27
28
29 class InvalidAddressType(exceptions.NeutronException):
30     message = _("Unknown address type %(address_type)s")
31
32
33 class IpAddressAllocationNotFound(exceptions.NeutronException):
34     message = _("Unable to find IP address %(ip_address)s on subnet "
35                 "%(subnet_id)s")
36
37
38 class IpAddressAlreadyAllocated(exceptions.Conflict):
39     message = _("IP address %(ip)s already allocated in subnet %(subnet_id)s")
40
41
42 class InvalidIpForSubnet(exceptions.BadRequest):
43     message = _("IP address %(ip)s does not belong to subnet %(subnet_id)s")
44
45
46 class InvalidAddressRequest(exceptions.BadRequest):
47     message = _("The address allocation request could not be satisfied "
48                 "because: %(reason)s")
49
50
51 class InvalidSubnetRequest(exceptions.BadRequest):
52     message = _("The subnet request could not be satisfied because: "
53                 "%(reason)s")
54
55
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")
60
61
62 class IpAddressGenerationFailure(exceptions.Conflict):
63     message = _("No more IP addresses available for subnet %(subnet_id)s.")
64
65
66 class IPAllocationFailed(exceptions.NeutronException):
67     message = _("IP allocation failed. Try again later.")
68
69
70 class IpamAvailabilityRangeNoChanges(exceptions.NeutronException):
71     message = _("New value for first_ip or last_ip has to be specified.")