Skip to content

Commit 26af97e

Browse files
author
Peter Amstutz
committed
Support for cwl:tool in job objects.
1 parent a366830 commit 26af97e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

cwltool/main.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,12 @@ def load_tool(argsworkflow, updateonly, strict, makeTool, debug, print_pre=False
270270
workflowobj = {"cwlVersion": "https://w3id.org/cwl/cwl#draft-2",
271271
"id": fileuri,
272272
"@graph": workflowobj}
273+
274+
jobobj = None
275+
if "cwl:tool" in workflowobj:
276+
jobobj = workflowobj
277+
workflowobj = document_loader.fetch(urlparse.urljoin(uri, workflowobj["cwl:tool"]))
278+
273279
workflowobj = update.update(workflowobj, document_loader, fileuri)
274280
document_loader.idx.clear()
275281

@@ -301,6 +307,11 @@ def load_tool(argsworkflow, updateonly, strict, makeTool, debug, print_pre=False
301307
_logger.error("Tool definition failed initialization:\n%s", e, exc_info=(e if debug else False))
302308
return 1
303309

310+
if jobobj:
311+
for inp in t.tool["inputs"]:
312+
if shortname(inp["id"]) in jobobj:
313+
inp["default"] = jobobj[shortname(inp["id"])]
314+
304315
return t
305316

306317
def main(args=None,

0 commit comments

Comments
 (0)