Skip to content

Commit 3ab8e95

Browse files
committed
load_tool.py: Raise validation exception when unsupported CWL Version is used
1 parent 7e07f3a commit 3ab8e95

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cwltool/load_tool.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
from . import process, update
2323
from .errors import WorkflowException
2424
from .process import Process, shortname
25+
from .update import ALLUPDATES
26+
from .main import supportedCWLversions
2527

2628
_logger = logging.getLogger("cwltool")
2729

@@ -161,6 +163,8 @@ def validate_document(document_loader, # type: Loader
161163
if "cwlVersion" in workflowobj:
162164
if not isinstance(workflowobj["cwlVersion"], (str, Text)):
163165
raise Exception("'cwlVersion' must be a string, got %s" % type(workflowobj["cwlVersion"]))
166+
if workflowobj["cwlVersion"] not in list(ALLUPDATES):
167+
raise ValidationException("'cwlVersion' not valid. Supported CWL versions are: ", supportedCWLversions(enable_dev=False))
164168
workflowobj["cwlVersion"] = re.sub(
165169
r"^(?:cwl:|https://w3id.org/cwl/cwl#)", "",
166170
workflowobj["cwlVersion"])

0 commit comments

Comments
 (0)