fix: handle empty input regions (#4842)

Co-authored-by: Sergio Garcia <38561120+sergargar@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2024-08-22 14:24:27 -04:00
committed by GitHub
parent 6c56ce6daa
commit ea4bf5b484
2 changed files with 9 additions and 1 deletions
+1 -1
View File
@@ -78,7 +78,7 @@ class AwsProvider(Provider):
# MFA Configuration (false by default)
input_mfa = getattr(arguments, "mfa", None)
input_profile = getattr(arguments, "profile", None)
input_regions = set(getattr(arguments, "region", set()))
input_regions = set(getattr(arguments, "region", []) or [])
organizations_role_arn = getattr(arguments, "organizations_role", None)
# Set if unused services must be scanned
+8
View File
@@ -755,6 +755,14 @@ aws:
assert aws_provider.mutelist.mutelist == mutelist["Mutelist"]
assert aws_provider.mutelist.mutelist_file_path == dynamodb_mutelist_path
@mock_aws
def test_empty_input_regions_in_arguments(self):
arguments = Namespace()
arguments.region = None
aws_provider = AwsProvider(arguments)
assert isinstance(aws_provider, AwsProvider)
@mock_aws
def test_generate_regional_clients_all_enabled_regions(self):
arguments = Namespace()