Skip to content

Commit 518e4a7

Browse files
Add fs_access for unknown URIs in relocateOutputs() _realpath(). (#1376)
1 parent 521425d commit 518e4a7

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

cwltool/job.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ def _execute(
409409
)
410410
else:
411411
raise ValueError(
412-
"'lsiting' in self.generatefiles but no "
412+
"'listing' in self.generatefiles but no "
413413
"generatemapper was setup."
414414
)
415415

cwltool/process.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -399,12 +399,13 @@ def _relocate(src: str, dst: str) -> None:
399399
def _realpath(
400400
ob: CWLObjectType,
401401
) -> None: # should be type Union[CWLFile, CWLDirectory]
402-
if cast(str, ob["location"]).startswith("file:"):
403-
ob["location"] = file_uri(
404-
os.path.realpath(uri_file_path(cast(str, ob["location"])))
405-
)
406-
if cast(str, ob["location"]).startswith("/"):
407-
ob["location"] = os.path.realpath(cast(str, ob["location"]))
402+
location = cast(str, ob["location"])
403+
if location.startswith("file:"):
404+
ob["location"] = file_uri(os.path.realpath(uri_file_path(location)))
405+
elif location.startswith("/"):
406+
ob["location"] = os.path.realpath(location)
407+
elif not location.startswith("_:") and ":" in location:
408+
ob["location"] = file_uri(fs_access.realpath(location))
408409

409410
outfiles = list(_collectDirEntries(outputObj))
410411
visit_class(outfiles, ("File", "Directory"), _realpath)

0 commit comments

Comments
 (0)