Merge lp:~lifeless/python-oops-tools/hostname into lp:python-oops-tools

Proposed by Robert Collins
Status: Merged
Approved by: Robert Collins
Approved revision: 21
Merged at revision: 19
Proposed branch: lp:~lifeless/python-oops-tools/hostname
Merge into: lp:python-oops-tools
Diff against target: 65 lines (+15/-0)
4 files modified
src/oopstools/NEWS.txt (+6/-0)
src/oopstools/oops/models.py (+5/-0)
src/oopstools/oops/templates/oops.html (+2/-0)
src/oopstools/oops/test/pagetest.txt (+2/-0)
To merge this branch: bzr merge lp:~lifeless/python-oops-tools/hostname
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+82466@code.launchpad.net

Commit message

Show the host and reporter for OOPSes in the detailed view of an OOPS.

Description of the change

Might be useful to know the host an oops occurred on, right?

To post a comment you must log in.
21. By Robert Collins

Expose reporter as well.

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 08:08:33 +0000
3+++ src/oopstools/NEWS.txt 2011-11-16 23:24:24 +0000
4@@ -11,6 +11,9 @@
5 * Flush stdout when logging an OOPS receipt in amqp2disk.
6 (Robert Collins, #884569)
7
8+* Hostnames are now shown in the OOPS detail page. This makes it possible to
9+ figure out if one host in particular is having trouble. (Robert Collins)
10+
11 * Long oops ids - which are likely hashes - no longer have the old appserver id
12 heuristic applied to them: if they have a missing or empty reporter, they are
13 associated with the instance 'unknown'. (Robert Collins, #889982)
14@@ -27,6 +30,9 @@
15 Timelines without this information will show 'unknown' in the relevant
16 column on the OOPS page. (Robert Collins, #890976)
17
18+* The OOPS reporter field - or prefix as it was known - is now shown
19+ in the OOPS details page. (Robert Collins)
20+
21 * The req_vars variable in OOPS reports may now be a dict.
22 (Robert Collins, #888866)
23
24
25=== modified file 'src/oopstools/oops/models.py'
26--- src/oopstools/oops/models.py 2011-11-16 08:08:33 +0000
27+++ src/oopstools/oops/models.py 2011-11-16 23:24:24 +0000
28@@ -523,6 +523,11 @@
29 self.parsed_oops = _get_oops(self.pathname)
30 return self.parsed_oops
31
32+ @readproperty
33+ def hostname(self):
34+ # Currently from oops reports only.
35+ return self.parsed_oops.get('hostname', 'Unknown') or 'Unknown'
36+
37 def _set_values(self):
38 ignore, self.req_vars, self.statements, self.traceback = (
39 _get_oops_tuple(self.parsed_oops))
40
41=== modified file 'src/oopstools/oops/templates/oops.html'
42--- src/oopstools/oops/templates/oops.html 2011-11-16 08:08:33 +0000
43+++ src/oopstools/oops/templates/oops.html 2011-11-16 23:24:24 +0000
44@@ -37,6 +37,8 @@
45 <div id="exception">
46 <li>Date: <span>{{ oops.date }}</span></li>
47 <li>Page-id: <span>{{ oops.pageid }}</span></li>
48+ <li>Reporter: <span>{{ oops.prefix.value }}</span></li>
49+ <li>Hostname: <span>{{ oops.hostname }}</span></li>
50 {% ifequal oops.oopsinfestation.last_seen_oops.oopsid oops.oopsid %}
51 <li>(This is the most recent instance.) </li>
52 {% else %}
53
54=== modified file 'src/oopstools/oops/test/pagetest.txt'
55--- src/oopstools/oops/test/pagetest.txt 2011-11-16 08:08:33 +0000
56+++ src/oopstools/oops/test/pagetest.txt 2011-11-16 23:24:24 +0000
57@@ -35,6 +35,8 @@
58 <...
59 ...<title>OOPS-1308x1</title>...
60 ...
61+ ...Reporter: <span>X</span>...
62+ ...Hostname: <span>Unknown</span>...
63 ...<div id="request_variables">...
64 ...
65 ...<li>CHANNEL_CREATION_TIME: 1...</li>...

Subscribers

People subscribed via source and target branches

to all changes: