From a5a1094b8c67242da18c2ac2b7370e7b3a7b696f Mon Sep 17 00:00:00 2001
From: chausman <chausman@nrao.edu>
Date: Thu, 16 Sep 2021 09:58:10 -0600
Subject: [PATCH] fixing subspace file creation

---
 .../system/services/remote_processing_service.py          | 5 +++--
 .../workspaces/workflow/services/workflow_service.py      | 8 ++++----
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/shared/workspaces/workspaces/system/services/remote_processing_service.py b/shared/workspaces/workspaces/system/services/remote_processing_service.py
index cf5d7baa2..4c50fb569 100644
--- a/shared/workspaces/workspaces/system/services/remote_processing_service.py
+++ b/shared/workspaces/workspaces/system/services/remote_processing_service.py
@@ -33,6 +33,7 @@ class CapoInjector:
         if RemoteProcessingSites.NAASC.value in self.request.argument:
             system = current.split("-")[1]
             remote_profile = "naasc-" + system
+            logger.info(f"profile for request: {remote_profile}")
             return remote_profile
 
         return current
@@ -94,10 +95,10 @@ class CapoInjector:
 
         path = self.dir_path / subspace.filename
         path.write_bytes(subspace.content)
-        logger.info(f"Writing capo subspace file to {self.dir_path}")
+        logger.info(f"Writing capo subspace file to {self.dir_path.__str__()}")
 
     def clear_subspace(self):
-        logger.info(f"Clearing capo subspace file from {self.dir_path}...")
+        logger.info(f"Clearing capo subspace file from {self.dir_path.__str__()}...")
         for file in os.listdir(self.dir_path):
             if file.endswith(".properties"):
                 Path.unlink(self.dir_path / file)
diff --git a/shared/workspaces/workspaces/workflow/services/workflow_service.py b/shared/workspaces/workspaces/workflow/services/workflow_service.py
index 6add78b7f..fea0e5f4e 100644
--- a/shared/workspaces/workspaces/workflow/services/workflow_service.py
+++ b/shared/workspaces/workspaces/workflow/services/workflow_service.py
@@ -220,14 +220,14 @@ class WorkflowService(WorkflowServiceIF):
         logger.info("Looking up workflow %s", request.workflow_name)
         definition = self.info.lookup_workflow_definition(request.workflow_name)
 
-        # Is this a remote execution workflow?
-        injector = CapoInjector(request)
-        remote = injector.is_remote_workflow()
-
         # create a temporary directory if processing directory is not supplied,
         # needs to exist before template rendering
         temp_folder = self._make_temp_directory(request) if not request.results_dir else Path(request.results_dir)
 
+        # Is this a remote execution workflow?
+        injector = CapoInjector(request)
+        remote = injector.is_remote_workflow()
+
         # if remote is true, create a capo subspace file in the request's directory
         if remote:
             logger.info("Creating Subspace File...")
-- 
GitLab