-
Notifications
You must be signed in to change notification settings - Fork 0
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
Log errors but do not raise SystemExit for encumbrances script #1426
Conversation
I modified the fix_encumbrances script to print the "info" and "warning" statements to stdout (the log file) and the "errors" to both stdout and the logger. |
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.
Do you want to address the non-zero amounts thing here or in a different PR? I'm okay either way.
@@ -723,9 +750,9 @@ async def unrelease_encumbrances_with_non_zero_amounts( | |||
async def unrelease_open_orders_encumbrances_with_nonzero_amounts( | |||
fiscal_year_id, open_orders_ids | |||
): | |||
logger.info('Unreleasing open orders encumbrances with non-zero amounts...') | |||
print('Unreleasing open orders encumbrances with non-zero amounts...') |
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.
Is this the one where we updated it to fix it even if it has zero amounts? I think we should fixup the warning message too.
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.
I think that was
# if enc['encumbrance']['sourcePoLineId'] == poline_id and float(enc['amount']) != 0.0 and \ |
The fix_encumbrances dag will not email the log if there is an error that raises SystemExit(1). Log the errors and always complete the script.