Skip to content

Commit 84ccb1b

Browse files
committed
Add --skip_schemas to avoid loading external schemas
Fixes #433
1 parent 6d3e9f0 commit 84ccb1b

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

cwltool/load_tool.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ def validate_document(document_loader, # type: Loader
133133
enable_dev=False, # type: bool
134134
strict=True, # type: bool
135135
preprocess_only=False, # type: bool
136-
fetcher_constructor=None
136+
fetcher_constructor=None,
137+
skip_schemas=None
137138
# type: Callable[[Dict[unicode, unicode], requests.sessions.Session], Fetcher]
138139
):
139140
# type: (...) -> Tuple[Loader, Names, Union[Dict[Text, Any], List[Dict[Text, Any]]], Dict[Text, Any], Text]
@@ -180,9 +181,10 @@ def validate_document(document_loader, # type: Loader
180181
raise avsc_names
181182

182183
processobj = None # type: Union[CommentedMap, CommentedSeq, unicode]
184+
183185
document_loader = Loader(sch_document_loader.ctx, schemagraph=sch_document_loader.graph,
184186
idx=document_loader.idx, cache=sch_document_loader.cache,
185-
fetcher_constructor=fetcher_constructor)
187+
fetcher_constructor=fetcher_constructor, skip_schemas=skip_schemas)
186188

187189
_add_blank_ids(workflowobj)
188190

cwltool/main.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ def arg_parser(): # type: () -> argparse.ArgumentParser
141141
exgroup.add_argument("--non-strict", action="store_false", help="Lenient validation (ignore unrecognized fields)",
142142
default=True, dest="strict")
143143

144+
parser.add_argument("--skip-schemas", action="store_true",
145+
help="Skip loading of schemas",
146+
default=True, dest="skip_schemas")
147+
144148
exgroup = parser.add_mutually_exclusive_group()
145149
exgroup.add_argument("--verbose", action="store_true", help="Default logging")
146150
exgroup.add_argument("--quiet", action="store_true", help="Only print warnings and errors.")
@@ -634,6 +638,7 @@ def main(argsl=None, # type: List[str]
634638
'enable_dev': False,
635639
'enable_ext': False,
636640
'strict': True,
641+
'skip_schemas': False,
637642
'rdf_serializer': None,
638643
'basedir': None,
639644
'tool_help': False,
@@ -701,7 +706,8 @@ def main(argsl=None, # type: List[str]
701706
= validate_document(document_loader, workflowobj, uri,
702707
enable_dev=args.enable_dev, strict=args.strict,
703708
preprocess_only=args.print_pre or args.pack,
704-
fetcher_constructor=fetcher_constructor)
709+
fetcher_constructor=fetcher_constructor,
710+
skip_schemas=args.skip_schemas)
705711

706712
if args.pack:
707713
stdout.write(print_pack(document_loader, processobj, uri, metadata))

0 commit comments

Comments
 (0)