Skip to content

Commit

Permalink
Merge branch 'main' into name-conflict-error
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Dec 3, 2020
2 parents ab858ed + 70dafe0 commit 0074471
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cwltool/command_line_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,7 @@ def collect_output(
rfile = files.copy()
revmap(rfile)
if files["class"] == "Directory":
ll = schema.get("loadListing") or builder.loadListing
ll = binding.get("loadListing") or builder.loadListing
if ll and ll != "no_listing":
get_listing(fs_access, files, (ll == "deep_listing"))
else:
Expand Down
13 changes: 7 additions & 6 deletions cwltool/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ def _execute(
stderr_path=stderr_path,
env=env,
cwd=self.outdir,
job_dir=runtimeContext.create_outdir(),
make_job_dir=lambda: runtimeContext.create_outdir(),
job_script_contents=job_script_contents,
timelimit=self.timelimit,
name=self.name,
Expand Down Expand Up @@ -909,7 +909,7 @@ def _job_popen(
stderr_path: Optional[str],
env: MutableMapping[str, str],
cwd: str,
job_dir: str,
make_job_dir: Callable[[], str],
job_script_contents: Optional[str] = None,
timelimit: Optional[int] = None,
name: Optional[str] = None,
Expand Down Expand Up @@ -1004,11 +1004,12 @@ def terminate(): # type: () -> None
"stdin_path": stdin_path,
}

with open(
os.path.join(job_dir, "job.json"), mode="w", encoding="utf-8"
) as job_file:
json_dump(job_description, job_file, ensure_ascii=False)
job_dir = make_job_dir()
try:
with open(
os.path.join(job_dir, "job.json"), mode="w", encoding="utf-8"
) as job_file:
json_dump(job_description, job_file, ensure_ascii=False)
job_script = os.path.join(job_dir, "run_job.bash")
with open(job_script, "wb") as _:
_.write(job_script_contents.encode("utf-8"))
Expand Down
5 changes: 3 additions & 2 deletions cwltool/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,7 @@ def inc(d): # type: (List[int]) -> None

files = [] # type: List[CWLObjectType]
bindings = CommentedSeq()
outdir = ""
tmpdir = ""
stagedir = ""

Expand Down Expand Up @@ -852,8 +853,8 @@ def inc(d): # type: (List[int]) -> None
tmpdir = runtime_context.docker_tmpdir or "/tmp" # nosec
stagedir = runtime_context.docker_stagedir or "/var/lib/cwl"
else:
outdir = fs_access.realpath(runtime_context.get_outdir())
if self.tool["class"] != "Workflow":
if self.tool["class"] == "CommandLineTool":
outdir = fs_access.realpath(runtime_context.get_outdir())
tmpdir = fs_access.realpath(runtime_context.get_tmpdir())
stagedir = fs_access.realpath(runtime_context.get_stagedir())

Expand Down

0 comments on commit 0074471

Please sign in to comment.