BB: Catch KeyError and log a warning message when starting single tests

This commit is contained in:
Ilija Lazoroski 2022-08-01 15:37:33 +02:00
parent 759de2a055
commit 7a9ab9c58a
1 changed files with 6 additions and 1 deletions

View File

@ -42,7 +42,12 @@ def GCPHandler(request, no_gcp, machines_to_start):
if not no_gcp: if not no_gcp:
list_machines = GCP_TEST_MACHINE_LIST list_machines = GCP_TEST_MACHINE_LIST
if machines_to_start: if machines_to_start:
try:
list_machines = GCP_SINGLE_TEST_LIST[machines_to_start] list_machines = GCP_SINGLE_TEST_LIST[machines_to_start]
except KeyError as err:
LOGGER.warning(
f"Partial or wrong test name provided. " f"Starting all GCP machines:{err}"
)
try: try:
initialize_gcp_client() initialize_gcp_client()
start_machines(list_machines) start_machines(list_machines)