From e6c5eea6a625792f729bffe8c9c305aff7aaf3bf Mon Sep 17 00:00:00 2001
From: chausman <chausman@nrao.edu>
Date: Mon, 17 Jun 2024 13:17:31 -0600
Subject: [PATCH] finish cleanup

---
 .../system/services/casa_matrix_service.py        | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/shared/workspaces/workspaces/system/services/casa_matrix_service.py b/shared/workspaces/workspaces/system/services/casa_matrix_service.py
index 50e2c50e4..891bd68bf 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
-- 
GitLab