From 50642bd832966b98dd1f5e9461fb3cbdd3b2aa3c Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Thu, 26 May 2022 09:25:49 +1000 Subject: [PATCH] Update eks_test_utils.py --- tests/providers/amazon/aws/utils/eks_test_utils.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tests/providers/amazon/aws/utils/eks_test_utils.py b/tests/providers/amazon/aws/utils/eks_test_utils.py index 01ba4ac779683..235658f777095 100644 --- a/tests/providers/amazon/aws/utils/eks_test_utils.py +++ b/tests/providers/amazon/aws/utils/eks_test_utils.py @@ -164,14 +164,10 @@ def region_matches_partition(region: str, partition: str) -> bool: ("us-gov-iso-b-", "aws-iso-b"), ] - return next( - ( - partition == expected_partition - for prefix, expected_partition in valid_matches - if region.startswith(prefix) - ), - partition == "aws", - ) + for prefix, expected_partition in valid_matches: + if region.startswith(prefix): + return partition == expected_partition + return partition == "aws" def _input_builder(options: InputTypes, minimal: bool) -> Dict: