Use extension fip-port-details from neutron-lib
The fip-port-details extension's API definition was added into neutron-lib with https://review.openstack.org/#/c/534882/ This patch consumes it by using the API definition. It also bumps the requires to use neutron-lib 1.14.0 NeutronLibImpact Change-Id: I9a93c0aef247f6145f3a55a44d08844d74b44eff
This commit is contained in:
parent
ee442a1537
commit
88688fb108
@ -1,43 +0,0 @@
|
||||
# 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.
|
||||
|
||||
"""
|
||||
TODO(hongbin): This module should be deleted once neutron-lib containing
|
||||
https://review.openstack.org/#/c/534882/ change is released.
|
||||
"""
|
||||
|
||||
from neutron_lib.api.definitions import l3
|
||||
from neutron_lib import constants
|
||||
|
||||
|
||||
PORT_DETAILS = 'port_details'
|
||||
|
||||
ALIAS = 'fip-port-details'
|
||||
IS_SHIM_EXTENSION = False
|
||||
IS_STANDARD_ATTR_EXTENSION = False
|
||||
NAME = 'Floating IP Port Details Extension'
|
||||
DESCRIPTION = 'Add port_details attribute to Floating IP resource'
|
||||
UPDATED_TIMESTAMP = '2018-04-09T10:00:00-00:00'
|
||||
RESOURCE_ATTRIBUTE_MAP = {
|
||||
l3.FLOATINGIPS: {
|
||||
PORT_DETAILS: {
|
||||
'allow_post': False, 'allow_put': False,
|
||||
'default': constants.ATTR_NOT_SPECIFIED,
|
||||
'is_visible': True
|
||||
}
|
||||
}
|
||||
}
|
||||
SUB_RESOURCE_ATTRIBUTE_MAP = {}
|
||||
ACTION_MAP = {}
|
||||
REQUIRED_EXTENSIONS = [l3.ALIAS]
|
||||
OPTIONAL_EXTENSIONS = []
|
||||
ACTION_STATUS = {}
|
@ -10,10 +10,9 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from neutron_lib.api.definitions import fip_port_details as apidef
|
||||
from neutron_lib.api import extensions
|
||||
|
||||
from neutron.extensions import _fip_port_details_lib as apidef
|
||||
|
||||
|
||||
class Fip_port_details(extensions.APIExtensionDescriptor):
|
||||
"""Extension class adding port_details to Floating IP."""
|
||||
|
@ -12,10 +12,10 @@
|
||||
# under the License.
|
||||
#
|
||||
|
||||
from neutron_lib.api.definitions import fip_port_details as apidef
|
||||
from oslo_config import cfg
|
||||
|
||||
from neutron.db import l3_fip_port_details
|
||||
from neutron.extensions import _fip_port_details_lib as apiref
|
||||
from neutron.extensions import l3
|
||||
from neutron.tests.unit.extensions import test_l3
|
||||
|
||||
@ -36,13 +36,13 @@ class TestFloatingIPPortDetailsIntPlugin(
|
||||
test_l3.TestL3NatIntPlugin,
|
||||
l3_fip_port_details.Fip_port_details_db_mixin):
|
||||
supported_extension_aliases = ["external-net", "router",
|
||||
apiref.ALIAS]
|
||||
apidef.ALIAS]
|
||||
|
||||
|
||||
class TestFloatingIPPortDetailsL3NatServicePlugin(
|
||||
test_l3.TestL3NatServicePlugin,
|
||||
l3_fip_port_details.Fip_port_details_db_mixin):
|
||||
supported_extension_aliases = ["router", apiref.ALIAS]
|
||||
supported_extension_aliases = ["router", apidef.ALIAS]
|
||||
|
||||
|
||||
class FloatingIPPortDetailsDBTestCaseBase(test_l3.L3NatTestCaseMixin):
|
||||
|
Loading…
Reference in New Issue
Block a user