Raise exception if a role policy is not found
This commit is contained in:
parent
af0205b6a3
commit
67326ace4f
2 changed files with 10 additions and 0 deletions
|
|
@ -685,6 +685,7 @@ class IAMBackend(BaseBackend):
|
|||
for p, d in role.policies.items():
|
||||
if p == policy_name:
|
||||
return p, d
|
||||
raise IAMNotFoundException("Policy Document {0} not attached to role {1}".format(policy_name, role_name))
|
||||
|
||||
def list_role_policies(self, role_name):
|
||||
role = self.get_role(role_name)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue