← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Robert Collins has proposed merging lp:~lifeless/python-oops-tools/hostname into lp:python-oops-tools.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~lifeless/python-oops-tools/hostname/+merge/82466

Might be useful to know the host an oops occurred on, right?
-- 
https://code.launchpad.net/~lifeless/python-oops-tools/hostname/+merge/82466
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~lifeless/python-oops-tools/hostname into lp:python-oops-tools.
=== modified file 'src/oopstools/NEWS.txt'
--- src/oopstools/NEWS.txt	2011-11-16 08:08:33 +0000
+++ src/oopstools/NEWS.txt	2011-11-16 23:12:25 +0000
@@ -11,6 +11,9 @@
 * Flush stdout when logging an OOPS receipt in amqp2disk.
   (Robert Collins, #884569)
 
+* Hostnames are now shown in the OOPS detail page. This makes it possible to
+  figure out if one host in particular is having trouble. (Robert Collins)
+
 * Long oops ids - which are likely hashes - no longer have the old appserver id
   heuristic applied to them: if they have a missing or empty reporter, they are
   associated with the instance 'unknown'. (Robert Collins, #889982)

=== modified file 'src/oopstools/oops/models.py'
--- src/oopstools/oops/models.py	2011-11-16 08:08:33 +0000
+++ src/oopstools/oops/models.py	2011-11-16 23:12:25 +0000
@@ -523,6 +523,11 @@
         self.parsed_oops = _get_oops(self.pathname)
         return self.parsed_oops
 
+    @readproperty
+    def hostname(self):
+        # Currently from oops reports only.
+        return self.parsed_oops.get('hostname', 'Unknown') or 'Unknown'
+
     def _set_values(self):
         ignore, self.req_vars, self.statements, self.traceback = (
             _get_oops_tuple(self.parsed_oops))

=== modified file 'src/oopstools/oops/templates/oops.html'
--- src/oopstools/oops/templates/oops.html	2011-11-16 08:08:33 +0000
+++ src/oopstools/oops/templates/oops.html	2011-11-16 23:12:25 +0000
@@ -37,6 +37,7 @@
   <div id="exception">
     <li>Date: <span>{{ oops.date }}</span></li>
     <li>Page-id: <span>{{ oops.pageid }}</span></li>
+    <li>Hostname: <span>{{ oops.hostname }}</span></li>
     {% ifequal oops.oopsinfestation.last_seen_oops.oopsid oops.oopsid %}
       <li>(This is the most recent instance.) </li>
     {% else %}

=== modified file 'src/oopstools/oops/test/pagetest.txt'
--- src/oopstools/oops/test/pagetest.txt	2011-11-16 08:08:33 +0000
+++ src/oopstools/oops/test/pagetest.txt	2011-11-16 23:12:25 +0000
@@ -35,6 +35,7 @@
     <...
     ...<title>OOPS-1308x1</title>...
     ...
+    ...Hostname: <span>Unknown</span>...
     ...<div id="request_variables">...
     ...
     ...<li>CHANNEL_CREATION_TIME: 1...</li>...