Log traceback output when batch action subprocess fails

This commit is contained in:
Lance Edgar 2022-08-09 16:35:48 -05:00
parent 5952df82ff
commit a6d5b262f9

View file

@ -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):
"""