-
Notifications
You must be signed in to change notification settings - Fork 34
CSM BDS: python scripts TypeError with --state reverted #990
Comments
The script prints out the list of user jobs fine until it hit the TypeError, when jobs have state = reverted. Bill found out from the database or indices that "reverted" jobs have empty "end_time". And, python3 flags that as a TypeError when it tried to print out the job record, as in this print statement:
To fix that, we need to check the field
Adding the line "condition = ..." to make the code more readable for checking the field with |
Similar fix can also be applied to another script
|
Thanks @thanh-lam for working with me and writing this up. I'm the process of reviewing some of the other scripts to ensure we catch similar cases. I will add the details to this specific issue. |
Similar fix can also be applied to another script
|
@thanh-lam These are some examples of the query after the fix was implemented.
|
Fixed by PR #994. |
@thanh-lam I'm going to leave this issue open until you have a chance to verify the fix in the next CAST build. |
Describe the bug
For querying allocation data, CSM provides python scripts in /opt/ibm/csm/bigdata/python/. One example is "findUserJobs.py" that lists allocation info such as "state" and so on of a job. It produced following error when running with --state reverted. Other states (running, failed, complete) were listed with no error.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The command should not produce the error (which looked like an internal condition needed to be handled with the reverted state). Example of a good command output:
Environment (please complete the following information):
Additional context
The TypeError could be caused by some "empty" field in the data record with reverted state.
Issue Source:
CSM regression tests.
The text was updated successfully, but these errors were encountered: