diff --git a/shared/workspaces/workspaces/system/services/casa_matrix_service.py b/shared/workspaces/workspaces/system/services/casa_matrix_service.py index f4c6468c206ec2ea471b388e1fdbfee9e03d9f40..2148d382777b3cac9cd54680fcd3951bb1e41ad0 100644 --- a/shared/workspaces/workspaces/system/services/casa_matrix_service.py +++ b/shared/workspaces/workspaces/system/services/casa_matrix_service.py @@ -42,7 +42,7 @@ RELEASE_CASA_REGEX = r"^casa-[0-9\.\-]*(pipeline-)?.*" DEV_CASA_REGEX = r"^casa-[0-9\.\-]*(pipeline-)?[^tp]" CASA_VERSION_REGEX = r"[a-zA-Z\-]+([\d]+(\.[\d]+){2}(-[\d]+){0,1}).*" PIPELINE_VERSION_REGEX = r".*([\d]{4}(\.[\d]+){3}).*" -EL_SUFFIX_REGEX = r"el[0-9]+$" +EL_SUFFIX_REGEX = r"[\.\-]el[0-9]+$" def casa_version_from_path(path: str) -> str: @@ -60,7 +60,8 @@ def casa_version_from_path(path: str) -> str: cv_search = re.search(CASA_VERSION_REGEX, path) pv_search = re.search(PIPELINE_VERSION_REGEX, path) if cv_search: - casa_version = cv_search.group(1) + # Replace last '-' in the directory name with '.' to match versions stored in the database + casa_version = '.'.join(cv_search.group(1).rsplit('-', 1)) if pv_search: # Strip el* from the release name (used to be a thing) pipeline_version = re.sub(EL_SUFFIX_REGEX, "", pv_search.group(1))