-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DM-37298 Add usage message for bps report in PanDA plugin #32
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -409,14 +409,21 @@ 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: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm really nitpicking here, but can we please move line 423 just before this if statement, so the definition of the variable is closer to its usage? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moved. I know it's better for reading. |
||
message = f"No records found for workflow id '{wms_workflow_id}'. Hint: double check the id" | ||
else: | ||
head = tasks[0] | ||
wms_report = WmsRunReport( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just FYI, I realized that this exception will not be handled by the method's caller, the
report()
function. As a result, the user will see entire traceback that lead to this error. And that may be perfectly fine in this case as I'm assuming the issues with iDDS sever are important enough that it is better to provide entire traceback instead of the brief error message. However, if this is not a critical error you still may want just to pass the error message like any other.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True. For this exception, I leave it as is.