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
=== modified file 'src/oopstools/NEWS.txt'
--- src/oopstools/NEWS.txt 2011-11-16 23:21:38 +0000
+++ src/oopstools/NEWS.txt 2011-11-21 04:04:23 +0000
@@ -8,6 +8,10 @@
8* Corrupt timeline objects are handled more gracefully if they are not a list,8* Corrupt timeline objects are handled more gracefully if they are not a list,
9 or the list rows are too short or too long. (Robert Collins, #890001)9 or the list rows are too short or too long. (Robert Collins, #890001)
1010
11* Failures in processing an AMQP sourced OOPS will now write out the path to
12 the disk copy of the failed OOPS, to ease debugging.
13 (Robert Collins, #892914)
14
11* Flush stdout when logging an OOPS receipt in amqp2disk.15* Flush stdout when logging an OOPS receipt in amqp2disk.
12 (Robert Collins, #884569)16 (Robert Collins, #884569)
1317
1418
=== modified file 'src/oopstools/scripts/amqp2disk.py'
--- src/oopstools/scripts/amqp2disk.py 2011-11-02 21:29:36 +0000
+++ src/oopstools/scripts/amqp2disk.py 2011-11-21 04:04:23 +0000
@@ -125,9 +125,13 @@
125 try:125 try:
126 res = Oops.objects.get(oopsid__exact=report['id'])126 res = Oops.objects.get(oopsid__exact=report['id'])
127 except Oops.DoesNotExist:127 except Oops.DoesNotExist:
128 res = parsed_oops_to_model_oops(128 oops_path = report['datedir_repo_filepath']
129 report, report['datedir_repo_filepath'])129 try:
130 return res.oopsid130 res = parsed_oops_to_model_oops(report, oops_path)
131 return res.oopsid
132 except:
133 sys.stderr.write('Failed while processing %s\n' % oops_path)
134 raise
131 return None135 return None
132136
133137

Subscribers

People subscribed via source and target branches

to all changes: