From 097ac7490fa8e83ff67dc8863f6ed5f29ba9c1d4 Mon Sep 17 00:00:00 2001 From: Fred-sun Date: Thu, 16 Jan 2025 17:17:31 +0800 Subject: [PATCH] Remove the ending character('/') that configures scope when comparing scope values --- plugins/modules/azure_rm_roleassignment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/modules/azure_rm_roleassignment.py b/plugins/modules/azure_rm_roleassignment.py index f989146a6..f63892d2d 100644 --- a/plugins/modules/azure_rm_roleassignment.py +++ b/plugins/modules/azure_rm_roleassignment.py @@ -335,7 +335,7 @@ def get_roleassignment(self): if self.scope and self.assignee_object_id and self.role_definition_id: response = list(self.authorization_client.role_assignments.list()) response = [self.roleassignment_to_dict(role_assignment) for role_assignment in response] - response = [role_assignment for role_assignment in response if role_assignment.get('scope') == self.scope] + response = [role_assignment for role_assignment in response if role_assignment.get('scope') == self.scope.rstrip("/")] response = [role_assignment for role_assignment in response if role_assignment.get('assignee_object_id') == self.assignee_object_id] response = [role_assignment for role_assignment in response if (role_assignment.get('role_definition_id').split('/')[-1].lower() == self.role_definition_id.split('/')[-1].lower())]