Skip to content

Commit

Permalink
ensure an empty list is returned if the label does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderegg committed Mar 21, 2023
1 parent 2c4df34 commit 8dc8be7
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8dc8be7

Please sign in to comment.