Skip to content

Commit 8d8612c

Browse files
authored
Merge pull request #52 from common-workflow-language/arv-fixes
Some small fixups for submitting runs on Arvados.
2 parents ceebd75 + a31616a commit 8d8612c

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

wes_client/wes_client_main.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ def main(argv=sys.argv[1:]):
8181
json.dump(response.result(), sys.stdout, indent=4)
8282
return 0
8383

84+
if not args.workflow_url:
85+
parser.print_help()
86+
return 1
87+
8488
if args.workflow_url.lower().endswith('wdl'):
8589
wf_type = 'WDL'
8690
elif args.workflow_url.lower().endswith('cwl'):
@@ -96,7 +100,7 @@ def main(argv=sys.argv[1:]):
96100
"location": {"@type": "@id"},
97101
"path": {"@type": "@id"}
98102
})
99-
input_dict, _ = loader.resolve_ref(args.job_order)
103+
input_dict, _ = loader.resolve_ref(args.job_order, checklinks=False)
100104

101105
basedir = os.path.dirname(args.job_order)
102106

@@ -146,7 +150,11 @@ def fixpaths(d):
146150
files=parts,
147151
headers={"Authorization": args.auth})
148152

149-
r = json.loads(postresult.text)
153+
try:
154+
r = json.loads(postresult.text)
155+
except ValueError:
156+
logging.error("%s", postresult.text)
157+
exit(1)
150158

151159
if postresult.status_code != 200:
152160
logging.error("%s", r)

wes_service/arvados_wes.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,6 @@ def invoke_cwl_runner(self, cr_uuid, workflow_url, workflow_params,
155155
def RunWorkflow(self, **args):
156156
tempdir, body = self.collect_attachments()
157157

158-
print(body)
159-
160158
if not connexion.request.headers.get('Authorization'):
161159
raise MissingAuthorization()
162160

@@ -214,7 +212,10 @@ def GetRunLog(self, run_id):
214212
if request["output_uuid"]:
215213
c = arvados.collection.CollectionReader(request["output_uuid"], api_client=api)
216214
with c.open("cwl.output.json") as f:
217-
outputobj = json.load(f)
215+
try:
216+
outputobj = json.load(f)
217+
except ValueError:
218+
pass
218219

219220
def keepref(d):
220221
if isinstance(d, dict) and "location" in d:

0 commit comments

Comments
 (0)