use get instead of direct dict access
This commit is contained in:
parent
fc7f3fecb6
commit
56c78ee39f
1 changed files with 2 additions and 2 deletions
|
|
@ -61,10 +61,10 @@ class RoleConfigQuery(ConfigQueryModel):
|
||||||
) or aggregator.get("organization_aggregation_source")
|
) or aggregator.get("organization_aggregation_source")
|
||||||
for source in aggregator_sources:
|
for source in aggregator_sources:
|
||||||
source_dict = source.__dict__
|
source_dict = source.__dict__
|
||||||
if source_dict["all_aws_regions"]:
|
if source_dict.get("all_aws_regions", False):
|
||||||
aggregated_regions = boto3.Session().get_available_regions("config")
|
aggregated_regions = boto3.Session().get_available_regions("config")
|
||||||
break
|
break
|
||||||
for region in source_dict["aws_regions"]:
|
for region in source_dict.get("aws_regions", []):
|
||||||
aggregated_regions.append(region)
|
aggregated_regions.append(region)
|
||||||
|
|
||||||
duplicate_role_list = []
|
duplicate_role_list = []
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue