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

Proposed by Robert Collins
Status: Merged
Approved by: Robert Collins
Approved revision: not available
Merged at revision: 28
Proposed branch: lp:~lifeless/python-oops-tools/own-oops
Merge into: lp:python-oops-tools
Diff against target: 136 lines (+56/-3)
7 files modified
buildout-templates/bin/oopstools.wsgi.in (+28/-2)
buildout-templates/src/oopstools/settings.py.in (+7/-0)
buildout.cfg (+8/-0)
setup.py (+1/-0)
src/oopstools/NEWS.txt (+3/-0)
src/oopstools/README.txt (+8/-1)
versions.cfg (+1/-0)
To merge this branch: bzr merge lp:~lifeless/python-oops-tools/own-oops
Reviewer Review Type Date Requested Status
Robert Collins (community) Approve
Review via email: mp+85288@code.launchpad.net

Commit message

If oops-tools breaks, log an OOPS.

Description of the change

If oops-tools breaks, log an OOPS.

To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) wrote :

self reviewing - this is 99% boilerplate.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'buildout-templates/bin/oopstools.wsgi.in'
--- buildout-templates/bin/oopstools.wsgi.in 2011-10-13 20:18:51 +0000
+++ buildout-templates/bin/oopstools.wsgi.in 2011-12-12 06:17:24 +0000
@@ -11,5 +11,31 @@
11os.environ['DJANGO_SETTINGS_MODULE'] = "oopstools.settings"11os.environ['DJANGO_SETTINGS_MODULE'] = "oopstools.settings"
1212
13import django.core.handlers.wsgi13import django.core.handlers.wsgi
1414from oops_wsgi.django import OOPSWSGIHandler
15application = django.core.handlers.wsgi.WSGIHandler()15
16application = OOPSWSGIHandler()
17
18# Report OOPSes back to us.
19from functools import partial
20from oops import Config
21from oops_wsgi import make_app, install_hooks
22# Transports - AMQP live (dev only service, no need for fallback transport)
23from oops_amqp import Publisher
24from amqplib import client_0_8 as amqp
25
26from django.conf import settings
27
28config = Config()
29config.template['reporter'] = '${configuration:oops-web-amqp-reporter}'
30install_hooks(config)
31# Can add custom filters / hooks if needed - see docs.
32factory = partial(amqp.Connection, host=settings.OOPS_WEB_AMQP_HOST,
33 userid=settings.OOPS_WEB_AMQP_USER,
34 password=settings.OOPS_WEB_AMQP_PASSWORD,
35 virtual_host=settings.OOPS_WEB_AMQP_VHOST, insist=False)
36publisher = Publisher(
37 factory, settings.OOPS_WEB_AMQP_EXCHANGE, settings.OOPS_WEB_AMQP_ROUTING)
38config.publishers.append(publisher)
39
40# finally we can wrap the app with OOPS reporting
41application = make_app(application, config, oops_on_status=['500'])
1642
=== modified file 'buildout-templates/src/oopstools/settings.py.in'
--- buildout-templates/src/oopstools/settings.py.in 2011-10-13 20:18:51 +0000
+++ buildout-templates/src/oopstools/settings.py.in 2011-12-12 06:17:24 +0000
@@ -113,3 +113,10 @@
113 'oopstools.oops',113 'oopstools.oops',
114 'south'114 'south'
115)115)
116
117OOPS_WEB_AMQP_HOST = '${configuration:oops-web-amqp-host}'
118OOPS_WEB_AMQP_USER = '${configuration:oops-web-amqp-user}'
119OOPS_WEB_AMQP_PASSWORD = '${configuration:oops-web-amqp-password}'
120OOPS_WEB_AMQP_VHOST = '${configuration:oops-web-amqp-vhost}'
121OOPS_WEB_AMQP_EXCHANGE = '${configuration:oops-web-amqp-exchange}'
122OOPS_WEB_AMQP_ROUTING = '${configuration:oops-web-amqp-routing}'
116123
=== modified file 'buildout.cfg'
--- buildout.cfg 2011-10-16 23:00:57 +0000
+++ buildout.cfg 2011-12-12 06:17:24 +0000
@@ -49,6 +49,14 @@
49report-to-address = test@example.com49report-to-address = test@example.com
50# Email address reports should be sent from.50# Email address reports should be sent from.
51report-from-address = test@example.com51report-from-address = test@example.com
52# Details for publishing OOPS reports that occur in the django web UI itself.
53oops-web-amqp-host = localhost
54oops-web-amqp-user = guest
55oops-web-amqp-password = guest
56oops-web-amqp-vhost = /
57oops-web-amqp-exchange = oopses
58oops-web-amqp-routing =
59oops-web-amqp-reporter = oops-tools-dev
5260
53[django]61[django]
54recipe = djangorecipe62recipe = djangorecipe
5563
=== modified file 'setup.py'
--- setup.py 2011-12-08 05:26:06 +0000
+++ setup.py 2011-12-12 06:17:24 +0000
@@ -56,6 +56,7 @@
56 'oops',56 'oops',
57 'oops-amqp',57 'oops-amqp',
58 'oops-datedir-repo',58 'oops-datedir-repo',
59 'oops-wsgi',
59 'psycopg2',60 'psycopg2',
60 'pytz',61 'pytz',
61 'setuptools',62 'setuptools',
6263
=== modified file 'src/oopstools/NEWS.txt'
--- src/oopstools/NEWS.txt 2011-12-08 03:44:45 +0000
+++ src/oopstools/NEWS.txt 2011-12-12 06:17:24 +0000
@@ -12,6 +12,9 @@
12 the disk copy of the failed OOPS, to ease debugging.12 the disk copy of the failed OOPS, to ease debugging.
13 (Robert Collins, #892914)13 (Robert Collins, #892914)
1414
15* Failures in the Django web UI will now raise an OOPS over AMQP, making
16 oops-tools an oops-tools consumer. (Robert Collins)
17
15* Flush stdout when logging an OOPS receipt in amqp2disk.18* Flush stdout when logging an OOPS receipt in amqp2disk.
16 (Robert Collins, #884569)19 (Robert Collins, #884569)
1720
1821
=== modified file 'src/oopstools/README.txt'
--- src/oopstools/README.txt 2011-10-16 22:35:01 +0000
+++ src/oopstools/README.txt 2011-12-12 06:17:24 +0000
@@ -61,7 +61,9 @@
61oopsdir = /path/where/rsynced/oopses/are/found61oopsdir = /path/where/rsynced/oopses/are/found
62 /another/such/path62 /another/such/path
6363
64Update settings.py setting a custom SECRET_KEY64Update settings.py setting a custom SECRET_KEY, and appropriate AMQP connection
65details (so that the oops-tools web site itself can report errors, should they
66occur).
6567
66To deploy oops tools make sure all the dependecies are installed.68To deploy oops tools make sure all the dependecies are installed.
6769
@@ -82,6 +84,11 @@
82creation to publish over AMQP. If you are using Python then the oops-amqp84creation to publish over AMQP. If you are using Python then the oops-amqp
83module will help you do this.85module will help you do this.
8486
87The Django web UI also integrates with AMQP to report errors that occur
88rendering or searching for OOPS reports. The settings to control this are in
89settings.py (or in your configuration file which buildout compiles into a
90settings.py).
91
85Running locally92Running locally
86===============93===============
8794
8895
=== modified file 'versions.cfg'
--- versions.cfg 2011-12-08 18:32:44 +0000
+++ versions.cfg 2011-12-12 06:17:24 +0000
@@ -22,6 +22,7 @@
22oops = 0.0.1022oops = 0.0.10
23oops-amqp = 0.0.523oops-amqp = 0.0.5
24oops-datedir-repo = 0.0.1524oops-datedir-repo = 0.0.15
25oops-wsgi = 0.0.9
25# XXX: 2011-11-17 GavinPanella bug=891249: pyscopg2 2.4.2 is26# XXX: 2011-11-17 GavinPanella bug=891249: pyscopg2 2.4.2 is
26# incompatible with Django 1.3, but 2.4.1 works fine.27# incompatible with Django 1.3, but 2.4.1 works fine.
27psycopg2 = 2.4.128psycopg2 = 2.4.1

Subscribers

People subscribed via source and target branches

to all changes: