Files
deb-python-neutron-lib/neutron_lib/api/definitions/__init__.py
Boden R 9cabefd0af rehome extra_dhcp_opt api-def
This patch rehomes the extra_dhcp_opt extension
from neutron.extensions into the API definitions
within neutron-lib. As part of the rehome some
refactoring is done:
- The DHCP opt exceptions are removed; one is never used [1]
and the other extends InvalidInput and is only used in the
validator [2] and can be replaced by a vanilla InvalidInput
exception.
- The validator is refactored and moved into validators.
- The 'id' EXTRA_DHCP_OPT_KEY_SPECS is removed as its
unused.
- The validator in lib is registered as type
'type:list_of_extra_dhcp_options' which is slightly
different than the original type. This is intentional to
ensure the rehome/consume goes smoothly and the
same validator is not registered multiple times.

UTs + release note also included.

In addition a bugfix is included that's required for the validator
herein. The problem is that if data is passed into
_validate_list_of_items that is a list of dicts, a TypeError is
raised because dicts are unhashable.

This api-def is used in stadium sub-projects such as
networking-ovn and is therefore a candidate for
rehoming.

[1] http://codesearch.openstack.org/?q=ExtraDhcpOptNotFound
[2] http://codesearch.openstack.org/?q=ExtraDhcpOptBadData

Change-Id: Ic55b6a1db38634cab7854538f77632115f1b7ec6
2017-04-25 08:43:00 -06:00

55 lines
1.8 KiB
Python

# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from neutron_lib.api.definitions import bgpvpn
from neutron_lib.api.definitions import data_plane_status
from neutron_lib.api.definitions import extra_dhcp_opt
from neutron_lib.api.definitions import fip64
from neutron_lib.api.definitions import firewall
from neutron_lib.api.definitions import firewall_v2
from neutron_lib.api.definitions import firewallrouterinsertion
from neutron_lib.api.definitions import l3
from neutron_lib.api.definitions import logging_resource
from neutron_lib.api.definitions import network
from neutron_lib.api.definitions import port
from neutron_lib.api.definitions import port_security
from neutron_lib.api.definitions import portbindings
from neutron_lib.api.definitions import provider_net
from neutron_lib.api.definitions import router_interface_fip
from neutron_lib.api.definitions import subnet
from neutron_lib.api.definitions import subnetpool
from neutron_lib.api.definitions import trunk
from neutron_lib.api.definitions import trunk_details
_ALL_API_DEFINITIONS = {
bgpvpn,
data_plane_status,
extra_dhcp_opt,
fip64,
firewall,
firewall_v2,
firewallrouterinsertion,
l3,
logging_resource,
network,
port,
port_security,
portbindings,
provider_net,
router_interface_fip,
subnet,
subnetpool,
trunk,
trunk_details
}