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
1=== modified file 'src/oopstools/scripts/prune.py'
2--- src/oopstools/scripts/prune.py 2012-09-26 07:27:56 +0000
3+++ src/oopstools/scripts/prune.py 2012-12-05 17:34:32 +0000
4@@ -87,7 +87,7 @@
5 'One of options %s must be supplied' % (optnames,))
6 needed('project', 'projectgroup')
7 logging.basicConfig(
8- filename='prune.log', filemode='w', level=logging.DEBUG)
9+ filename='logs/prune.log', filemode='w', level=logging.DEBUG)
10 one_week = datetime.timedelta(weeks=1)
11 one_day = datetime.timedelta(days=1)
12 # Only prune OOPS reports more than one week old.
13
14=== modified file 'src/oopstools/scripts/report.py'
15--- src/oopstools/scripts/report.py 2012-08-07 03:57:32 +0000
16+++ src/oopstools/scripts/report.py 2012-12-05 17:34:32 +0000
17@@ -84,7 +84,7 @@
18 body_text = (
19 'Full summary available at:\n'
20 ' %s/%s.html\n\n' % (settings.SUMMARY_URI, report_filename))
21- body_text += open(txt_file).read()
22+ body_text += open(txt_file).read().decode('utf-8', 'replace')
23 else:
24 body_text = "No %s OOPSes found for %s" % (
25 report.title, yesterday_string)

Subscribers

People subscribed via source and target branches

to all changes: