aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gn_libs/jobs/jobs.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/gn_libs/jobs/jobs.py b/gn_libs/jobs/jobs.py
index 8d77139..ec1c3a8 100644
--- a/gn_libs/jobs/jobs.py
+++ b/gn_libs/jobs/jobs.py
@@ -92,7 +92,7 @@ def initialise_job(# pylint: disable=[too-many-arguments, too-many-positional-ar
command: list,
job_type: str,
extra_meta: Optional[dict] = None,
- expiry_seconds: Optional[int] = _DEFAULT_EXPIRY_SECONDS_
+ expiry_seconds: int = _DEFAULT_EXPIRY_SECONDS_
) -> dict:
"""Initialise the job and put the details in a SQLite3 database."""
if extra_meta is None:
@@ -115,7 +115,7 @@ def initialise_job(# pylint: disable=[too-many-arguments, too-many-positional-ar
def output_file(jobid: uuid.UUID, outdir: Path, stream: str) -> Path:
"""Compute the path for the file where the launcher's `stream` output goes"""
assert stream in ("stdout", "stderr"), f"Invalid stream '{stream}'"
- return f"{outdir}/launcher_job_{jobid}.{stream}"
+ return outdir.joinpath(f"launcher_job_{jobid}.{stream}")
stdout_filename = partial(output_file, stream="stdout")
@@ -146,10 +146,10 @@ def launch_job(
os.mkdir(error_dir)
job_id = str(the_job["job_id"])
- with (open(stderr_filename(jobid=job_id, outdir=error_dir),
+ with (open(stderr_filename(jobid=the_job["job_id"], outdir=error_dir),
"w",
encoding="utf-8") as stderrfile,
- open(stdout_filename(jobid=job_id, outdir=error_dir),
+ open(stdout_filename(jobid=the_job["job_id"], outdir=error_dir),
"w",
encoding="utf-8") as stdoutfile):
subprocess.Popen( # pylint: disable=[consider-using-with]