From 9cda591affaa1f821409961ec4e379e1bf5fa248 Mon Sep 17 00:00:00 2001 From: Marco Donadoni Date: Wed, 20 Nov 2024 16:38:08 +0100 Subject: [PATCH] fix(htcondorcern): run provided command in unpacked image (#474) Closes #471 --- reana_job_controller/htcondorcern_job_manager.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reana_job_controller/htcondorcern_job_manager.py b/reana_job_controller/htcondorcern_job_manager.py index ffe965fc..7b7795bf 100644 --- a/reana_job_controller/htcondorcern_job_manager.py +++ b/reana_job_controller/htcondorcern_job_manager.py @@ -9,6 +9,7 @@ import base64 import logging import os +import shlex import threading from shutil import copyfile @@ -235,9 +236,10 @@ def _copy_wrapper_file(self): "--bind $PWD:/srv " "--bind /cvmfs " "--bind /eos " - "{DOCKER_IMG} {CMD}".format( + "{DOCKER_IMG} " + "bash -c {CMD}".format( DOCKER_IMG=self.docker_img, - CMD=self._format_arguments() + " | bash", + CMD=shlex.quote(self._format_arguments() + " | bash"), ) ) f = open("job_singularity_wrapper.sh", "w")