From 8dc8be730cd28b840c83f536a5e30b81ea5147e6 Mon Sep 17 00:00:00 2001 From: sanderegg <35365065+sanderegg@users.noreply.github.com> Date: Tue, 21 Mar 2023 10:17:50 +0100 Subject: [PATCH] ensure an empty list is returned if the label does not exist --- .../simcore_service_catalog/api/routes/services_resources.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/services/catalog/src/simcore_service_catalog/api/routes/services_resources.py b/services/catalog/src/simcore_service_catalog/api/routes/services_resources.py index ae0b3d66d354..8f5c1051bf24 100644 --- a/services/catalog/src/simcore_service_catalog/api/routes/services_resources.py +++ b/services/catalog/src/simcore_service_catalog/api/routes/services_resources.py @@ -55,7 +55,8 @@ def _compute_service_available_boot_modes( currently this uses the simcore.service.settings labels if available for backwards compatiblity. if MPI is found, then boot mode is set to MPI, if GPU is found then boot mode is set to GPU, else to CPU. In the future a dedicated label might be used, to add openMP for example. and to not abuse the resources of a service. - Also these will be used in a project to allow the user to choose among different boot modes""" + Also these will be used in a project to allow the user to choose among different boot modes + """ resource_entries = filter(lambda entry: entry.name.lower() == "resources", settings) generic_resources = {} @@ -160,7 +161,7 @@ def _get_service_settings( ) -> list[SimcoreServiceSettingLabelEntry]: service_settings = parse_raw_as( list[SimcoreServiceSettingLabelEntry], - labels.get(SIMCORE_SERVICE_SETTINGS_LABELS, ""), + labels.get(SIMCORE_SERVICE_SETTINGS_LABELS, "[]"), ) logger.debug("received %s", f"{service_settings=}") return service_settings