From 291d64adaa44617b19a66cbbb250c4079f12fe26 Mon Sep 17 00:00:00 2001 From: Matt Crees Date: Thu, 23 Oct 2025 11:59:14 +0100 Subject: [PATCH] Fix: Include target_project_id in RBAC creation This fixes an issue where we cannot create multiple Neutron RBAC policies using the same source project and network. Closes-Bug: #2129677 Change-Id: Ib3c63131f9ae09abd03fc7d619e3566267690216 Signed-off-by: Matt Crees --- changelogs/fragments/rbac_target_project_id.yaml | 3 +++ plugins/modules/neutron_rbac_policy.py | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/rbac_target_project_id.yaml diff --git a/changelogs/fragments/rbac_target_project_id.yaml b/changelogs/fragments/rbac_target_project_id.yaml new file mode 100644 index 00000000..36bc9b72 --- /dev/null +++ b/changelogs/fragments/rbac_target_project_id.yaml @@ -0,0 +1,3 @@ +--- +bugfixes: + - Include target_project_id in RBAC creation diff --git a/plugins/modules/neutron_rbac_policy.py b/plugins/modules/neutron_rbac_policy.py index cb46d438..aedf032f 100644 --- a/plugins/modules/neutron_rbac_policy.py +++ b/plugins/modules/neutron_rbac_policy.py @@ -252,7 +252,7 @@ class NeutronRBACPolicy(OpenStackModule): matches = self._find_matches() if len(matches) > 1: - self.fail_json(msg='Found more a single matching RBAC policy' + self.fail_json(msg='Found more than a single matching RBAC policy' ' which match the given parameters.') elif len(matches) == 1: return matches[0] @@ -269,7 +269,8 @@ class NeutronRBACPolicy(OpenStackModule): .format(', '.join(missing_keys))) kwargs = dict((k, self.params[k]) - for k in ['action', 'object_type', 'project_id']) + for k in ['action', 'object_type', 'project_id', + 'target_project_id']) policies = self.conn.network.rbac_policies(**kwargs)