use get instead of direct dict access

This commit is contained in:
Nick Stocchero 2020-09-21 17:42:22 -06:00
parent fc7f3fecb6
commit 56c78ee39f

View File

@ -61,10 +61,10 @@ class RoleConfigQuery(ConfigQueryModel):
) or aggregator.get("organization_aggregation_source")
for source in aggregator_sources:
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")
break
for region in source_dict["aws_regions"]:
for region in source_dict.get("aws_regions", []):
aggregated_regions.append(region)
duplicate_role_list = []