fix policy attribute exception (#4868)

This commit is contained in:
Josh Kaplinsky 2022-02-17 06:39:43 -06:00 committed by GitHub
parent f49c81037b
commit 5daa104a6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2339,7 +2339,8 @@ class IAMBackend(BaseBackend):
user.delete_policy(policy_name)
def delete_policy(self, policy_arn):
del self.managed_policies[policy_arn]
policy = self.get_policy(policy_arn)
del self.managed_policies[policy.arn]
def create_access_key(self, user_name=None, status="Active"):
user = self.get_user(user_name)