Skip to content

Commit

Permalink
Do not ask to select from list with single element
Browse files Browse the repository at this point in the history
A consequence of observations on the simplified hello.cwl and common-workflow-library/legacy#60 .
  • Loading branch information
smoe committed Feb 16, 2016
1 parent f048715 commit 5c8360a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions cwltool/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,13 @@ def load_tool(argsworkflow, updateonly, strict, makeTool, debug,
if urifrag:
processobj, _ = document_loader.resolve_ref(uri)
elif isinstance(processobj, list):
_logger.error("Tool file contains graph of multiple objects, must specify one of #%s",
", #".join(urlparse.urldefrag(i["id"])[1]
for i in processobj if "id" in i))
return 1
if 1 == len(processobj):
processobj = processobj[0]
else:
_logger.error("Tool file contains graph of multiple objects, must specify one of #%s",
", #".join(urlparse.urldefrag(i["id"])[1]
for i in processobj if "id" in i))
return 1

try:
t = makeTool(processobj, strict=strict, makeTool=makeTool, loader=document_loader, avsc_names=avsc_names)
Expand Down

0 comments on commit 5c8360a

Please sign in to comment.