Merge lp:~james-w/python-oops-tools/decode-reports into lp:python-oops-tools

Proposed by James Westby
Status: Merged
Approved by: James Westby
Approved revision: 49
Merged at revision: 50
Proposed branch: lp:~james-w/python-oops-tools/decode-reports
Merge into: lp:python-oops-tools
Diff against target: 25 lines (+2/-2)
2 files modified
src/oopstools/scripts/prune.py (+1/-1)
src/oopstools/scripts/report.py (+1/-1)
To merge this branch: bzr merge lp:~james-w/python-oops-tools/decode-reports
Reviewer Review Type Date Requested Status
James Westby (community) Approve
Review via email: mp+138267@code.launchpad.net

Commit message

Decode the report when reading it to send the email.

Description of the change

Hi,

These are a couple of changes that are currently cowboyed on the oops.canonical.com
server, so we should land them. I think they make sense, and have been running
fine in production for a while.

Thanks,

James

To post a comment you must log in.
Revision history for this message
James Westby (james-w) wrote :

I'm going to self-approve this one. I can come back and make changes later if needed.

Thanks,

James

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/oopstools/scripts/prune.py'
--- src/oopstools/scripts/prune.py 2012-09-26 07:27:56 +0000
+++ src/oopstools/scripts/prune.py 2012-12-05 17:34:32 +0000
@@ -87,7 +87,7 @@
87 'One of options %s must be supplied' % (optnames,))87 'One of options %s must be supplied' % (optnames,))
88 needed('project', 'projectgroup')88 needed('project', 'projectgroup')
89 logging.basicConfig(89 logging.basicConfig(
90 filename='prune.log', filemode='w', level=logging.DEBUG)90 filename='logs/prune.log', filemode='w', level=logging.DEBUG)
91 one_week = datetime.timedelta(weeks=1)91 one_week = datetime.timedelta(weeks=1)
92 one_day = datetime.timedelta(days=1)92 one_day = datetime.timedelta(days=1)
93 # Only prune OOPS reports more than one week old.93 # Only prune OOPS reports more than one week old.
9494
=== modified file 'src/oopstools/scripts/report.py'
--- src/oopstools/scripts/report.py 2012-08-07 03:57:32 +0000
+++ src/oopstools/scripts/report.py 2012-12-05 17:34:32 +0000
@@ -84,7 +84,7 @@
84 body_text = (84 body_text = (
85 'Full summary available at:\n'85 'Full summary available at:\n'
86 ' %s/%s.html\n\n' % (settings.SUMMARY_URI, report_filename))86 ' %s/%s.html\n\n' % (settings.SUMMARY_URI, report_filename))
87 body_text += open(txt_file).read()87 body_text += open(txt_file).read().decode('utf-8', 'replace')
88 else:88 else:
89 body_text = "No %s OOPSes found for %s" % (89 body_text = "No %s OOPSes found for %s" % (
90 report.title, yesterday_string)90 report.title, yesterday_string)

Subscribers

People subscribed via source and target branches

to all changes: