Skip to content

Commit fd32a6b

Browse files
jfennickmr-c
authored andcommitted
Fixed another symlinking issue with Docker + staged files from InitialWorkDirRequirement
1 parent 15a4f64 commit fd32a6b

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

cwltool/docker.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,9 @@ def add_file_or_directory_volume(
248248
"""Append volume a file/dir mapping to the runtime option list."""
249249
if not volume.resolved.startswith("_:"):
250250
_check_docker_machine_path(volume.resolved)
251-
self.append_volume(runtime, volume.resolved, volume.target)
251+
self.append_volume(
252+
runtime, volume.resolved, volume.target, writable=volume.staged
253+
)
252254

253255
def add_writable_file_volume(
254256
self,

cwltool/job.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,18 +95,13 @@ def relink_initialworkdir(
9595
continue
9696
host_outdir_tgt = os.path.join(host_outdir, vol.target[len(container_outdir) + 1 :])
9797
if os.path.islink(host_outdir_tgt) or os.path.isfile(host_outdir_tgt):
98-
try:
99-
os.remove(host_outdir_tgt)
100-
except PermissionError:
101-
pass
98+
subprocess.run(["chmod", "777", host_outdir_tgt], check=True)
99+
os.remove(host_outdir_tgt)
102100
elif os.path.isdir(host_outdir_tgt) and not vol.resolved.startswith("_:"):
101+
subprocess.run(["chmod", "777", host_outdir_tgt], check=True)
103102
shutil.rmtree(host_outdir_tgt)
104103
if not vol.resolved.startswith("_:"):
105-
try:
106-
os.symlink(vol.resolved, host_outdir_tgt)
107-
except FileExistsError:
108-
pass
109-
104+
os.symlink(vol.resolved, host_outdir_tgt)
110105

111106
def neverquote(string: str, pos: int = 0, endpos: int = 0) -> Optional[Match[str]]:
112107
return None

0 commit comments

Comments
 (0)