Merge lp:~lifeless/python-oops-tools/bug-892914 into lp:python-oops-tools

Proposed by Robert Collins
Status: Merged
Approved by: Robert Collins
Approved revision: 21
Merged at revision: 21
Proposed branch: lp:~lifeless/python-oops-tools/bug-892914
Merge into: lp:python-oops-tools
Diff against target: 33 lines (+11/-3)
2 files modified
src/oopstools/NEWS.txt (+4/-0)
src/oopstools/scripts/amqp2disk.py (+7/-3)
To merge this branch: bzr merge lp:~lifeless/python-oops-tools/bug-892914
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+82842@code.launchpad.net

Commit message

Print out the path to the OOPS when amqp2disk fails to import it.

Description of the change

Currently failures in amqp2disk are horridly opaque. This prints out the path to the failed oops to make it easier to inspect them.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/oopstools/NEWS.txt'
2--- src/oopstools/NEWS.txt 2011-11-16 23:21:38 +0000
3+++ src/oopstools/NEWS.txt 2011-11-21 04:04:23 +0000
4@@ -8,6 +8,10 @@
5 * Corrupt timeline objects are handled more gracefully if they are not a list,
6 or the list rows are too short or too long. (Robert Collins, #890001)
7
8+* Failures in processing an AMQP sourced OOPS will now write out the path to
9+ the disk copy of the failed OOPS, to ease debugging.
10+ (Robert Collins, #892914)
11+
12 * Flush stdout when logging an OOPS receipt in amqp2disk.
13 (Robert Collins, #884569)
14
15
16=== modified file 'src/oopstools/scripts/amqp2disk.py'
17--- src/oopstools/scripts/amqp2disk.py 2011-11-02 21:29:36 +0000
18+++ src/oopstools/scripts/amqp2disk.py 2011-11-21 04:04:23 +0000
19@@ -125,9 +125,13 @@
20 try:
21 res = Oops.objects.get(oopsid__exact=report['id'])
22 except Oops.DoesNotExist:
23- res = parsed_oops_to_model_oops(
24- report, report['datedir_repo_filepath'])
25- return res.oopsid
26+ oops_path = report['datedir_repo_filepath']
27+ try:
28+ res = parsed_oops_to_model_oops(report, oops_path)
29+ return res.oopsid
30+ except:
31+ sys.stderr.write('Failed while processing %s\n' % oops_path)
32+ raise
33 return None
34
35

Subscribers

People subscribed via source and target branches

to all changes: