Dont retry endlessly if there is no account alias
This commit is contained in:
parent
1e12bd7807
commit
71753107cc
4
index.py
4
index.py
@ -84,6 +84,10 @@ def get_source(region, account_id):
|
|||||||
iam = boto3.client('iam')
|
iam = boto3.client('iam')
|
||||||
account_aliases[account_id] = iam.list_account_aliases()['AccountAliases'][0]
|
account_aliases[account_id] = iam.list_account_aliases()['AccountAliases'][0]
|
||||||
|
|
||||||
|
# if there is no alias disable further retries
|
||||||
|
if not account_aliases[account_id]:
|
||||||
|
RESOLVE_ACCOUNT = False
|
||||||
|
|
||||||
source['account_alias'] = account_aliases[account_id]
|
source['account_alias'] = account_aliases[account_id]
|
||||||
|
|
||||||
except(KeyError, IndexError):
|
except(KeyError, IndexError):
|
||||||
|
Loading…
Reference in New Issue
Block a user