Skip to content

Commit

Permalink
Add usage message for bps report in PanDA plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoyuyoung committed Dec 15, 2022
1 parent 2456b8c commit 74e9064
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions python/lsst/ctrl/bps/panda/panda_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,14 +409,22 @@ def report(self, wms_workflow_id=None, user=None, hist=0, pass_thru=None, is_glo
message = ""
run_reports = []

if not wms_workflow_id:
message = "Run summary not implemented yet, use 'bps report --id <workflow_id>' instead"
return run_reports, message

idds_client = self.get_idds_client()
ret = idds_client.get_requests(request_id=wms_workflow_id, with_detail=True)
_LOG.debug("PanDA get workflow status returned = %s", str(ret))

request_status = ret[0]
tasks = ret[1][1]
if request_status != 0 or not tasks:
if request_status != 0:
raise RuntimeError(f"Error to get workflow status: {ret} for id: {wms_workflow_id}")

tasks = ret[1][1]
if not tasks:
message = f"No records found for workflow id '{wms_workflow_id}'. Hint: double check the id"
return run_reports, message
else:
head = tasks[0]
wms_report = WmsRunReport(
Expand Down

0 comments on commit 74e9064

Please sign in to comment.