Debian Codegraph @

neutron_lib/exceptions/local_ip.py

raw
1 # Copyright 2021 Huawei, Inc.
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_lib._i18n import _
17 from neutron_lib import exceptions
18
19
20 class LocalIPNotFound(exceptions.NotFound):
21 message = _("Local IP %(id)s could not be found.")
22
23
24 class LocalIPInUse(exceptions.InUse):
25 message = _("Local IP %(id)s is still associated with one or more ports.")
26
27
28 class LocalIPNoIP(exceptions.InvalidInput):
29 message = _("Specified Port %(port_id)s has no fixed IPs configured.")
30
31
32 class LocalIPRequestedIPNotFound(exceptions.InvalidInput):
33 message = _("Specified Port %(port_id)s does not have "
34 "requested IP address: %(ip)s.")
35
36
37 class LocalIPNoRequestedIP(exceptions.InvalidInput):
38 message = _("Specified Port %(port_id)s has several IPs, "
39 "should specify exact IP address to use for Local IP.")
40
41
42 class LocalIPPortOrNetworkRequired(exceptions.InvalidInput):
43 message = _("Either Port ID or Network ID must be specified "
44 "for Local IP create.")
45
46
47 class LocalIPAssociationNotFound(exceptions.NotFound):
48 message = _("Local IP %(local_ip_id)s association with port %(port_id)s "
49 "could not be found.")