diff --git a/neutron_lib/api/definitions/__init__.py b/neutron_lib/api/definitions/__init__.py index 8b5d9e55d..bf2c2525b 100644 --- a/neutron_lib/api/definitions/__init__.py +++ b/neutron_lib/api/definitions/__init__.py @@ -51,6 +51,7 @@ from neutron_lib.api.definitions import l3 from neutron_lib.api.definitions import l3_ext_gw_mode from neutron_lib.api.definitions import l3_ext_ha_mode from neutron_lib.api.definitions import l3_flavors +from neutron_lib.api.definitions import l3_port_ip_change_not_allowed from neutron_lib.api.definitions import logging from neutron_lib.api.definitions import logging_resource from neutron_lib.api.definitions import metering @@ -145,6 +146,7 @@ _ALL_API_DEFINITIONS = { l3_ext_gw_mode, l3_ext_ha_mode, l3_flavors, + l3_port_ip_change_not_allowed, logging, logging_resource, metering, diff --git a/neutron_lib/api/definitions/base.py b/neutron_lib/api/definitions/base.py index d04775b92..ad9c170af 100644 --- a/neutron_lib/api/definitions/base.py +++ b/neutron_lib/api/definitions/base.py @@ -102,6 +102,7 @@ KNOWN_EXTENSIONS = ( 'ip-substring-filtering', 'l3-ha', 'l3_agent_scheduler', + 'l3-port-ip-change-not-allowed', 'logging', 'metering', 'multi-provider', diff --git a/neutron_lib/api/definitions/l3_port_ip_change_not_allowed.py b/neutron_lib/api/definitions/l3_port_ip_change_not_allowed.py new file mode 100644 index 000000000..a94fa3aaf --- /dev/null +++ b/neutron_lib/api/definitions/l3_port_ip_change_not_allowed.py @@ -0,0 +1,29 @@ +# 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 l3 + + +ALIAS = 'l3-port-ip-change-not-allowed' +IS_SHIM_EXTENSION = True +IS_STANDARD_ATTR_EXTENSION = False +NAME = 'Prevent L3 router ports IP address change extension' +DESCRIPTION = 'Prevent change of IP address for some L3 router ports' +UPDATED_TIMESTAMP = '2018-10-09T10:00:00-00:00' +RESOURCE_ATTRIBUTE_MAP = {} +SUB_RESOURCE_ATTRIBUTE_MAP = {} +ACTION_MAP = {} +REQUIRED_EXTENSIONS = [ + l3.ALIAS +] +OPTIONAL_EXTENSIONS = [] +ACTION_STATUS = {} diff --git a/neutron_lib/tests/unit/api/definitions/test_l3_port_ip_change_not_allowed.py b/neutron_lib/tests/unit/api/definitions/test_l3_port_ip_change_not_allowed.py new file mode 100644 index 000000000..bfcf7277d --- /dev/null +++ b/neutron_lib/tests/unit/api/definitions/test_l3_port_ip_change_not_allowed.py @@ -0,0 +1,18 @@ +# 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 l3_port_ip_change_not_allowed +from neutron_lib.tests.unit.api.definitions import base + + +class L3PortIPChangeNotAllowedDefinitionTestCase(base.DefinitionBaseTestCase): + extension_module = l3_port_ip_change_not_allowed diff --git a/releasenotes/notes/l3-port-ip-change-not-allow-2c98e13c08b5ee85.yaml b/releasenotes/notes/l3-port-ip-change-not-allow-2c98e13c08b5ee85.yaml new file mode 100644 index 000000000..2603a526f --- /dev/null +++ b/releasenotes/notes/l3-port-ip-change-not-allow-2c98e13c08b5ee85.yaml @@ -0,0 +1,9 @@ +--- +fixes: + - | + Directly updating some L3-related port IP addresses does not have any + effect on the L3 agent side. As a consequence, these L3-related ports + should not allow changing of their IP address. A new shim extension has + been added called ``l3-port-ip-change-not-allowed`` to prevent such IP + address change. For more information please see bug + `1796824 `_.