Skip to content

Commit 0a9524c

Browse files
author
Peter Amstutz
committed
Handle UnsupportedRequirement and return exit code 33. Add "pack" to internal set of configuration defaults.
1 parent efc29f3 commit 0a9524c

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

cwltool/errors.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
class WorkflowException(Exception):
22
pass
3+
4+
class UnsupportedRequirement(WorkflowException):
5+
pass

cwltool/main.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import logging
1111
import copy
1212
from . import workflow
13-
from .errors import WorkflowException
13+
from .errors import WorkflowException, UnsupportedRequirement
1414
from . import process
1515
from .cwlrdf import printrdf, printdot
1616
from .process import shortname, Process
@@ -542,7 +542,8 @@ def main(argsl=None,
542542
'basedir': None,
543543
'tool_help': False,
544544
'workflow': None,
545-
'job_order': None}.iteritems():
545+
'job_order': None,
546+
'pack': False}.iteritems():
546547
if not hasattr(args, k):
547548
setattr(args, k, v)
548549

@@ -662,6 +663,11 @@ def main(argsl=None,
662663
u"Input object failed validation:\n%s", exc,
663664
exc_info=(exc if args.debug else False))
664665
return 1
666+
except UnsupportedRequirement as exc:
667+
_logger.error(
668+
u"Workflow or tool uses unsupported feature:\n%s", exc,
669+
exc_info=(exc if args.debug else False))
670+
return 33
665671
except WorkflowException as exc:
666672
_logger.error(
667673
u"Workflow error, try again with --debug for more "

cwltool/process.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from .builder import Builder, adjustFileObjs
1919
import tempfile
2020
import glob
21-
from .errors import WorkflowException
21+
from .errors import WorkflowException, UnsupportedRequirement
2222
from .pathmapper import abspath
2323
from typing import Any, Callable, Generator, Union, IO, AnyStr, Tuple
2424
from collections import Iterable
@@ -120,10 +120,6 @@ def shortname(inputid):
120120
else:
121121
return d.path.split("/")[-1]
122122

123-
124-
class UnsupportedRequirement(Exception):
125-
pass
126-
127123
def checkRequirements(rec, supportedProcessRequirements):
128124
# type: (Any, Iterable[Any]) -> None
129125
if isinstance(rec, dict):

0 commit comments

Comments
 (0)