diff --git a/shared/workspaces/workspaces/system/services/casa_matrix_service.py b/shared/workspaces/workspaces/system/services/casa_matrix_service.py index 50e2c50e4d724b84a7e83bc722cfc879264a2703..891bd68bf0e3ca2aeb2dfe9be86370b182ddb9a4 100644 --- a/shared/workspaces/workspaces/system/services/casa_matrix_service.py +++ b/shared/workspaces/workspaces/system/services/casa_matrix_service.py @@ -58,25 +58,16 @@ def casa_version_from_path(path: str) -> str: # Defaults casa_version, pipeline_version = "unknown", "default" - def check_regex(regex: str, path_str: str) -> re.Match[str] | None: - """ - check casa paths against version and pipeline regexes - :param regex: - :param path_str: - :return: - """ - return re.search(regex, path_str) - - cv_search = check_regex(CASA_VERSION_REGEX, path) + cv_search = re.search(CASA_VERSION_REGEX, path) if cv_search is None: # this is probably a default link, make sure we use the actual version path path2 = pathlib.Path(path) if path2.is_symlink(): path = str(path2.readlink()) - cv_search = check_regex(CASA_VERSION_REGEX, path) + cv_search = re.search(CASA_VERSION_REGEX, path) - pv_search = check_regex(PIPELINE_VERSION_REGEX, path) + pv_search = re.search(PIPELINE_VERSION_REGEX, path) if cv_search: # Replace last '-' in the directory name with '.' to match versions stored in the database