Merge lp://qastaging/~brendan-donegan/hwcert-tools/batch_query_fix into lp://qastaging/~hardware-certification/hwcert-tools/reporting-tools
Proposed by
Brendan Donegan
Status: | Merged |
---|---|
Approved by: | Daniel Manrique |
Approved revision: | 131 |
Merged at revision: | 129 |
Proposed branch: | lp://qastaging/~brendan-donegan/hwcert-tools/batch_query_fix |
Merge into: | lp://qastaging/~hardware-certification/hwcert-tools/reporting-tools |
Diff against target: |
95 lines (+66/-12) 1 file modified
certification_reports/api_utils.py (+66/-12) |
To merge this branch: | bzr merge lp://qastaging/~brendan-donegan/hwcert-tools/batch_query_fix |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Daniel Manrique (community) | Approve | ||
Brendan Donegan (community) | Needs Resubmitting | ||
Review via email:
|
Description of the change
Miscellaneous improvements to batch_query. I'm trying to avoid the situation where a query doesn't return any results and the script just crashes. Because my scripts run on cron I'd like to mask this situation. This branch also shortens the code required for batch query with a bit of clever logic. There's still a couple of outstanding issues - one is that the code does nothing when an exception is raised, but should perhaps do some logging. The other is the question whether the failure of a query should raise an exception or just be ignored.
To post a comment you must log in.
Silently ignoring exceptions is bad (tm). I suggest at least logging the exception's error message. The merge request for checkbox- message- get-c4 has an example of how to do that.
Other than that this look awesome and will work well on both python2 and python3 which rocks!