|
10 | 10 | import logging
|
11 | 11 | import schema_salad.ref_resolver
|
12 | 12 | import requests
|
13 |
| -from requests.exceptions import InvalidSchema |
| 13 | +from requests.exceptions import InvalidSchema, MissingSchema |
14 | 14 | from wes_service.util import visit
|
15 | 15 | from bravado.client import SwaggerClient
|
16 | 16 | from bravado.requests_client import RequestsClient
|
@@ -81,6 +81,13 @@ def main(argv=sys.argv[1:]):
|
81 | 81 | json.dump(response.result(), sys.stdout, indent=4)
|
82 | 82 | return 0
|
83 | 83 |
|
| 84 | + if args.workflow_url.lower().endswith('wdl'): |
| 85 | + wf_type = 'WDL' |
| 86 | + elif args.workflow_url.lower().endswith('cwl'): |
| 87 | + wf_type = 'CWL' |
| 88 | + elif args.workflow_url.lower().endswith('py'): |
| 89 | + wf_type = 'PY' |
| 90 | + |
84 | 91 | loader = schema_salad.ref_resolver.Loader({
|
85 | 92 | "location": {"@type": "@id"},
|
86 | 93 | "path": {"@type": "@id"}
|
@@ -112,7 +119,7 @@ def fixpaths(d):
|
112 | 119 |
|
113 | 120 | parts = [
|
114 | 121 | ("workflow_params", json.dumps(input_dict)),
|
115 |
| - ("workflow_type", "CWL"), |
| 122 | + ("workflow_type", wf_type), |
116 | 123 | ("workflow_type_version", "v1.0")
|
117 | 124 | ]
|
118 | 125 | if workflow_url.startswith("file://"):
|
@@ -163,6 +170,8 @@ def fixpaths(d):
|
163 | 170 | logging.info("Workflow log:\n" + logs)
|
164 | 171 | except InvalidSchema:
|
165 | 172 | logging.info("Workflow log:\n" + str(s["workflow_log"]["stderr"]))
|
| 173 | + except MissingSchema: |
| 174 | + logging.info("Workflow log:\n" + str(s["workflow_log"]["stderr"])) |
166 | 175 |
|
167 | 176 | if "fields" in s["outputs"] and s["outputs"]["fields"] is None:
|
168 | 177 | del s["outputs"]["fields"]
|
|
0 commit comments