From 1d4da16374ff378543f03d85dbf5d564c8f38391 Mon Sep 17 00:00:00 2001 From: Oleg Bondarev Date: Wed, 29 Sep 2021 17:22:38 +0800 Subject: [PATCH] Add Local IP constants needed for policy checks Additionally adds required small fixes to API def Partial-Bug: #1930200 Change-Id: I1ec3185becf03bdc208b0af8c00d2794113a88d5 --- neutron_lib/api/definitions/local_ip.py | 8 +++++--- neutron_lib/plugins/constants.py | 1 + neutron_lib/services/constants.py | 4 +++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/neutron_lib/api/definitions/local_ip.py b/neutron_lib/api/definitions/local_ip.py index ec76e42f8..803e8b65b 100644 --- a/neutron_lib/api/definitions/local_ip.py +++ b/neutron_lib/api/definitions/local_ip.py @@ -108,6 +108,10 @@ SUB_RESOURCE_ATTRIBUTE_MAP = { 'parent': {'collection_name': COLLECTION_NAME, 'member_name': RESOURCE_NAME}, 'parameters': { + 'local_ip_id': { + 'allow_post': False, + 'allow_put': False, + 'is_visible': True}, 'local_ip_address': { 'allow_post': False, 'allow_put': False, @@ -140,9 +144,7 @@ SUB_RESOURCE_ATTRIBUTE_MAP = { 'allow_put': False, 'validate': {'type:string': db_const.PROJECT_ID_FIELD_SIZE}, 'required_by_policy': True, - 'is_filter': True, - 'is_sort_key': True, - 'is_visible': True}, + 'is_visible': False}, } } } diff --git a/neutron_lib/plugins/constants.py b/neutron_lib/plugins/constants.py index aa8a4001d..83546cf8e 100644 --- a/neutron_lib/plugins/constants.py +++ b/neutron_lib/plugins/constants.py @@ -26,6 +26,7 @@ FLOATINGIPPOOL = "FLOATINGIPPOOL" NETWORK_SEGMENT_RANGE = "NETWORK_SEGMENT_RANGE" CONNTRACKHELPER = "CONNTRACKHELPER" PLACEMENT_REPORT = "placement_report" +LOCAL_IP = "LOCAL_IP" # TODO(johnsom) Remove after these stop being used. Neutron-LBaaS is now # retired (train) and these should no longer be necessary. diff --git a/neutron_lib/services/constants.py b/neutron_lib/services/constants.py index 5a5f374fe..99b843bf7 100644 --- a/neutron_lib/services/constants.py +++ b/neutron_lib/services/constants.py @@ -13,6 +13,7 @@ # under the License. from neutron_lib.api.definitions import l3 +from neutron_lib.api.definitions import local_ip from neutron_lib.plugins import constants as plugin_const @@ -26,5 +27,6 @@ from neutron_lib.plugins import constants as plugin_const # registered the service plugin name in neutron-lib. EXT_PARENT_RESOURCE_MAPPING = { l3.FLOATINGIP: plugin_const.L3, - l3.ROUTER: plugin_const.CONNTRACKHELPER + l3.ROUTER: plugin_const.CONNTRACKHELPER, + local_ip.RESOURCE_NAME: plugin_const.LOCAL_IP }