Fixed an issue with the moto IAM backend when used in Thread Pools (#5882)

This commit is contained in:
Mike Grima 2023-01-30 06:20:13 -05:00 committed by GitHub
parent ef1fab008a
commit 4d7c9c9e70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -69,7 +69,8 @@ SERVICE_NAME_CONVERSION = {
def get_account_id_from(access_key: str) -> str:
for account_id, account in iam_backends.items():
# wrapped in a list() to avoid thread pooling problems (issue #5881)
for account_id, account in list(iam_backends.items()):
if access_key in account["global"].access_keys:
return account_id
return DEFAULT_ACCOUNT_ID