Skip to content

Commit

Permalink
Fixed mismatch assignment error (#613)
Browse files Browse the repository at this point in the history
* Fixed mismatch assignment error

* Added fix for the self.id version of the same check

Co-authored-by: Sebastian With Olsen <sebastian.w.olsen@simcorp.com>
  • Loading branch information
Spacebjorn and Sebastian With Olsen authored Feb 7, 2022
1 parent 765e82d commit e886409
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/modules/azure_rm_roleassignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit e886409

Please sign in to comment.