From e886409c09beb79d6866fe833747a121b6bc86ff Mon Sep 17 00:00:00 2001 From: Sebastian Olsen <30187002+Spacebjorn@users.noreply.github.com> Date: Mon, 7 Feb 2022 04:25:09 +0100 Subject: [PATCH] Fixed mismatch assignment error (#613) * Fixed mismatch assignment error * Added fix for the self.id version of the same check Co-authored-by: Sebastian With Olsen --- plugins/modules/azure_rm_roleassignment.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/modules/azure_rm_roleassignment.py b/plugins/modules/azure_rm_roleassignment.py index 6c2373e74..b7f4949e8 100644 --- a/plugins/modules/azure_rm_roleassignment.py +++ b/plugins/modules/azure_rm_roleassignment.py @@ -304,7 +304,7 @@ def get_roleassignment(self): self.fail('State Mismatch Error: The assignment ID exists, but does not match the provided assignee.') if role_assignment and self.role_definition_id and (role_assignment.get('role_definition_id').split('/')[-1].lower() - != self.role_definition_id[-1].lower()): + != self.role_definition_id.split('/')[-1].lower()): self.fail('State Mismatch Error: The assignment ID exists, but does not match the provided role.') except CloudError as ex: @@ -318,7 +318,7 @@ def get_roleassignment(self): self.fail('State Mismatch Error: The assignment name exists, but does not match the provided assignee.') if role_assignment and self.role_definition_id and (role_assignment.get('role_definition_id').split('/')[-1].lower() - != self.role_definition_id[-1].lower()): + != self.role_definition_id.split('/')[-1].lower()): self.fail('State Mismatch Error: The assignment name exists, but does not match the provided role.') except CloudError as ex: