Shell runner writes output to a file when not run via a scheduler
When called outside of a scheduler environment the shell runner will write all output from the called command to a text file. This emulates the behaviour of sub-tasks on a scheduler, but is not necessarily expected (or desired) behaviour when run outside of a scheduler environment (i.e. in a terminal session).
Consider, either as a configurable option, or automatically (when not called from within a scheduler environment) allowing stdout and(?) stderr to be passed through to the controlling session.
Proposed patch
def _run_job(job, job_id, child_env, stdout_file, stderr_file):
logger = _get_logger()
with open(stderr_file, mode='w') as stderr:
child_env['JOB_ID'] = str(job_id)
logger.info(
"executing: " + str(' '.join(job)))
output = sp.run(
job,
stderr=stderr,
universal_newlines=True,
env=child_env)
if output.returncode != 0:
with open(stderr_file, mode='r') as stderr:
err_msg = stderr.read()
raise BadSubmission(err_msg)