From acfb2fdc29ab6b22003903b16688cde373f5082a Mon Sep 17 00:00:00 2001 From: Rodolfo Alonso Hernandez Date: Sat, 12 Nov 2022 11:14:02 +0100 Subject: [PATCH] Added "qos" plugin to "EXT_PARENT_RESOURCE_MAPPING" The plugin "qos" is added to the "EXT_PARENT_RESOURCE_MAPPING" constant. The policy engine can now check the QoS rule ownership using the QoS policy project ID. The QoS rules are resources that do not have an assigned project ID, it is inherited from the QoS policy. This patch allows to check a QoS rule ownership using the "ext_parent_policy_id" field, that stores the QoS policy project ID. NOTE: once released, this bug fix must include Neutron unit tests checking, using the rules: "update_policy_bandwidth_limit_rule": "rule:admin_or_owner" "update_policy_packet_rate_limit_rule": "rule:admin_or_owner" "update_policy_dscp_marking_rule": "rule:admin_or_owner" "update_policy_minimum_bandwidth_rule": "rule:admin_or_owner" "update_policy_minimum_packet_rate_rule": "rule:admin_or_owner" Conflicts: neutron_lib/services/constants.py Closes-Bug: #1996606 Change-Id: I0531ea2c1bf29aecfab9b491eefef044a4ee49ad (cherry picked from commit 7e4a6beed43d28f7ab0c6c47ea056c70ea7b1fea) (cherry picked from commit 3f9cbe45252d93dac4c8dbd11c1629aec43137b0) --- neutron_lib/services/constants.py | 4 +++- .../qos-plugin-parent-resource-mapping-ab5208caba9eda01.yaml | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/qos-plugin-parent-resource-mapping-ab5208caba9eda01.yaml diff --git a/neutron_lib/services/constants.py b/neutron_lib/services/constants.py index 5a5f374fe..8182f451f 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 qos 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, + qos.POLICY: plugin_const.QOS, } diff --git a/releasenotes/notes/qos-plugin-parent-resource-mapping-ab5208caba9eda01.yaml b/releasenotes/notes/qos-plugin-parent-resource-mapping-ab5208caba9eda01.yaml new file mode 100644 index 000000000..842f9d773 --- /dev/null +++ b/releasenotes/notes/qos-plugin-parent-resource-mapping-ab5208caba9eda01.yaml @@ -0,0 +1,5 @@ +--- +other: + - | + Parent resource mapping was added to ``EXT_PARENT_RESOURCE_MAPPING`` in + ``neutron_lib.services.constants`` for the ``qos`` plugin.