From 715a5cb02f4687af2d279e3665ea2685ef86e7e3 Mon Sep 17 00:00:00 2001 From: TorecLuik Date: Thu, 20 Jun 2024 16:43:13 +0000 Subject: [PATCH] deploy: abe53026a2b8f064605a8ea0fc60c8cdb1fb0a27 --- _modules/biomero/slurm_client.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/_modules/biomero/slurm_client.html b/_modules/biomero/slurm_client.html index 01d0365..b96be6e 100644 --- a/_modules/biomero/slurm_client.html +++ b/_modules/biomero/slurm_client.html @@ -336,7 +336,7 @@

Source code for biomero.slurm_client

     _DEFAULT_SLURM_GIT_SCRIPT_PATH = "slurm-scripts"
     _OUT_SEP = "--split--"
     _VERSION_CMD = "ls -h \"{slurm_images_path}/{image_path}\" | grep -oP '(?<=\-|\_)(v.+|latest)(?=.simg|.sif)'"
-    _CONVERTER_VERSION_CMD = "ls -h \"{converter_path}\" | grep -oP '(convert_.+)(?=.simg|.sif)' | awk '{n=split($0, a, \"_\"); last=a[n]; sub(\"_\"last\"$\", \"\", $0); print $0, last}'"
+    _CONVERTER_VERSION_CMD = "ls -h \"{converter_path}\" | grep -oP '(convert_.+)(?=.simg|.sif)' | awk '{{n=split($0, a, \"_\"); last=a[n]; sub(\"_\"last\"$\", \"\", $0); print $0, last}}'"
     # Note, grep returns exitcode 1 if no match is found!
     # This will translate into a UnexpectedExit error, so mute that if you
     # don't care about empty.
@@ -598,8 +598,10 @@ 

Source code for biomero.slurm_client

         cmd = self._CONVERTER_VERSION_CMD.format(
             converter_path=self.slurm_converters_path),
         r = self.run_commands([cmd])
-        # split lines further into a k,v dict
-        result_dict = {line.rsplit(' ', 1)[0]: line.rsplit(' ', 1)[1] for line in r.split('\n')}
+        result_dict = {}
+        if r.ok:
+            # split lines further into a k,v dict
+            result_dict = {line.rsplit(' ', 1)[0]: line.rsplit(' ', 1)[1] for line in r.stdout.strip().split('\n')}
         return result_dict
[docs] def setup_converters(self):