fix(s3_regions): verify if there are filter regions (#1338)

Co-authored-by: sergargar <sergio@verica.io>
This commit is contained in:
Sergio Garcia
2022-08-22 09:30:26 +01:00
committed by GitHub
parent 6c36c599a5
commit 9b4415f7b3

View File

@@ -39,7 +39,11 @@ class S3:
"LocationConstraint"
]
if not bucket_region: # If us-east-1, bucket_region is none
buckets.append(Bucket(bucket["Name"], "us-east-1"))
bucket_region = "us-east-1"
# Check if there are filter regions
if current_audit_info.audited_regions:
if bucket_region in current_audit_info.audited_regions:
buckets.append(Bucket(bucket["Name"], bucket_region))
else:
buckets.append(Bucket(bucket["Name"], bucket_region))
return buckets