From 625b5d98166e7ad9327ad88121da40bc93e37278 Mon Sep 17 00:00:00 2001 From: Dmitry Pustoshilov Date: Tue, 27 Aug 2024 17:57:18 +0300 Subject: [PATCH] feature: add stream_type to RUN command like in EXEC --- spython/main/run.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spython/main/run.py b/spython/main/run.py index 1299b9f..db7a25b 100644 --- a/spython/main/run.py +++ b/spython/main/run.py @@ -26,6 +26,7 @@ def run( return_result=False, quiet=False, background=False, + stream_type="stdout", ): """ run will run the container, with or withour arguments (which @@ -49,6 +50,7 @@ def run( return_result: if True, return entire json object with return code and message result (default is False) quiet: print the command to the user + stream_type: Sets which output stream from the singularity command should be return. Values are 'stdout', 'stderr', 'both'. """ from spython.utils import check_install @@ -107,7 +109,7 @@ def run( elif not stream: result = self._run_command(cmd, sudo=sudo, return_result=return_result) else: - return stream_command(cmd, sudo=sudo) + return stream_command(cmd, sudo=sudo, output_type=stream_type) # If the user wants the raw result object if return_result: