Skip to content

Commit 5c8360a

Browse files
committed
Do not ask to select from list with single element
A consequence of observations on the simplified hello.cwl and common-workflow-library/legacy#60 .
1 parent f048715 commit 5c8360a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

cwltool/main.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,10 +313,13 @@ def load_tool(argsworkflow, updateonly, strict, makeTool, debug,
313313
if urifrag:
314314
processobj, _ = document_loader.resolve_ref(uri)
315315
elif isinstance(processobj, list):
316-
_logger.error("Tool file contains graph of multiple objects, must specify one of #%s",
317-
", #".join(urlparse.urldefrag(i["id"])[1]
318-
for i in processobj if "id" in i))
319-
return 1
316+
if 1 == len(processobj):
317+
processobj = processobj[0]
318+
else:
319+
_logger.error("Tool file contains graph of multiple objects, must specify one of #%s",
320+
", #".join(urlparse.urldefrag(i["id"])[1]
321+
for i in processobj if "id" in i))
322+
return 1
320323

321324
try:
322325
t = makeTool(processobj, strict=strict, makeTool=makeTool, loader=document_loader, avsc_names=avsc_names)

0 commit comments

Comments
 (0)