From a6d5b262f9dda1df5638553596ba7c30e885a190 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Tue, 9 Aug 2022 16:35:48 -0500 Subject: [PATCH] Log traceback output when batch action subprocess fails --- tailbone/views/batch/core.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tailbone/views/batch/core.py b/tailbone/views/batch/core.py index 77da3344..24aa94d4 100644 --- a/tailbone/views/batch/core.py +++ b/tailbone/views/batch/core.py @@ -962,7 +962,13 @@ class BatchMasterView(MasterView): # run command in subprocess log.debug("launching command in subprocess: %s", cmd) - subprocess.check_call(cmd) + try: + subprocess.check_output(cmd, stderr=subprocess.PIPE) + except subprocess.CalledProcessError as error: + log.warning("command failed with exit code %s! output was:", + error.returncode) + log.warning(error.stderr.decode('utf_8')) + raise def action_subprocess_thread(self, key, port, username, handler_action, progress, **kwargs): """