From 50741e3e2242445a3f4fe411a751abd17434ca3e Mon Sep 17 00:00:00 2001 From: Edward Hope-Morley Date: Tue, 17 Sep 2024 11:28:35 +0100 Subject: [PATCH] Fix func target voting test We need to support job defs that have not voting key which implies voting=True. Also adds __pycache__ to .gitignore --- .gitignore | 1 + openstack/tools/func_test_tools/test_is_voting.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 496748a..1d804f8 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ b bundles ssl/*/ microk8s/dockercreds +__pycache__ diff --git a/openstack/tools/func_test_tools/test_is_voting.py b/openstack/tools/func_test_tools/test_is_voting.py index cbc4540..b4a3239 100644 --- a/openstack/tools/func_test_tools/test_is_voting.py +++ b/openstack/tools/func_test_tools/test_is_voting.py @@ -48,5 +48,5 @@ if project['name'] == "charm-functional-jobs": for job in project['check']['jobs']: if target_name in job: - if not job[target_name]['voting']: + if not job[target_name].get('voting', True): sys.exit(1)