From 9f752025b6452345095cf55039abaf052ff74925 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 6 Nov 2023 16:11:11 -0600 Subject: [PATCH 1/2] DRIVERS-2747 Handle backwards compat --- .evergreen/auth_aws/aws_tester.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.evergreen/auth_aws/aws_tester.py b/.evergreen/auth_aws/aws_tester.py index b8b2fe4c..5b10d1e2 100644 --- a/.evergreen/auth_aws/aws_tester.py +++ b/.evergreen/auth_aws/aws_tester.py @@ -101,8 +101,13 @@ def setup_ecs(): text = fid.read() if 'jammy' in text: task_definition = CONFIG[get_key('iam_auth_ecs_task_definition_jammy')] + if task_definition is None: + raise ValueError('Please set "iam_auth_ecs_task_definition_jammy" variable') elif 'focal' in text: task_definition = CONFIG[get_key('iam_auth_ecs_task_definition_focal')] + # Fall back to previous task definition for backward compat. + if task_definition is None: + task_definition = CONFIG[get_key('iam_auth_ecs_task_definition')] else: raise ValueError('Unsupported ubuntu release') run_test_command = f"{base_command} -d -v run_e2e_test --cluster {CONFIG[get_key('iam_auth_ecs_cluster')]} --task_definition {task_definition} --subnets {CONFIG[get_key('iam_auth_ecs_subnet_a')]} --subnets {CONFIG[get_key('iam_auth_ecs_subnet_b')]} --security_group {CONFIG[get_key('iam_auth_ecs_security_group')]} --files {mongo_binaries}/mongod:/root/mongod {mongo_binaries}/mongosh:/root/mongosh lib/ecs_hosted_test.js:/root/ecs_hosted_test.js {project_dir}:/root --script lib/ecs_hosted_test.sh" From f06c5e4961270c0b472084ce10012812d4b88714 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 7 Nov 2023 10:08:20 -0600 Subject: [PATCH 2/2] fix dict access --- .evergreen/auth_aws/aws_tester.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.evergreen/auth_aws/aws_tester.py b/.evergreen/auth_aws/aws_tester.py index 5b10d1e2..0727f2c1 100644 --- a/.evergreen/auth_aws/aws_tester.py +++ b/.evergreen/auth_aws/aws_tester.py @@ -100,11 +100,11 @@ def setup_ecs(): with open('/etc/lsb-release') as fid: text = fid.read() if 'jammy' in text: - task_definition = CONFIG[get_key('iam_auth_ecs_task_definition_jammy')] + task_definition = CONFIG.get(get_key('iam_auth_ecs_task_definition_jammy'), None) if task_definition is None: raise ValueError('Please set "iam_auth_ecs_task_definition_jammy" variable') elif 'focal' in text: - task_definition = CONFIG[get_key('iam_auth_ecs_task_definition_focal')] + task_definition = CONFIG.get(get_key('iam_auth_ecs_task_definition_focal'), None) # Fall back to previous task definition for backward compat. if task_definition is None: task_definition = CONFIG[get_key('iam_auth_ecs_task_definition')]