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

Proposed by Robert Collins
Status: Merged
Approved by: Robert Collins
Approved revision: no longer in the source branch.
Merged at revision: 3
Proposed branch: lp:~lifeless/python-oops-tools/amqp
Merge into: lp:python-oops-tools
Diff against target: 91 lines (+18/-18)
3 files modified
src/oopstools/NEWS.txt (+2/-0)
src/oopstools/scripts/amqp2disk.py (+15/-17)
versions.cfg (+1/-1)
To merge this branch: bzr merge lp:~lifeless/python-oops-tools/amqp
Reviewer Review Type Date Requested Status
Stuart Bishop (community) Approve
Robert Collins (community) Approve
Review via email: mp+79644@code.launchpad.net

Commit message

Bump to oops-amqp 0.0.0.2, cleanup some cruft.

Description of the change

Bump to oops-amqp 0.0.0.2, cleanup some cruft.

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

simples

review: Approve
Revision history for this message
Stuart Bishop (stub) wrote :

In the name of Senate and Peoples of Rome.

review: Approve
lp:~lifeless/python-oops-tools/amqp updated
3. By Robert Collins

Bump to oops-amqp 0.0.0.2, cleanup some cruft.

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-10-16 22:35:01 +0000
3+++ src/oopstools/NEWS.txt 2011-10-18 04:22:22 +0000
4@@ -7,6 +7,8 @@
5
6 * Added AMQP support via the bin/amqp2disk script. (Robert Collins)
7
8+* Bumped oops-amqp rev to 0.0.2 for bugfixes. (Robert Collins)
9+
10 0.6
11 ===
12
13
14=== modified file 'src/oopstools/scripts/amqp2disk.py'
15--- src/oopstools/scripts/amqp2disk.py 2011-10-16 22:35:01 +0000
16+++ src/oopstools/scripts/amqp2disk.py 2011-10-18 04:22:22 +0000
17@@ -18,9 +18,9 @@
18
19 __metaclass__ = type
20
21+from functools import partial
22 import sys
23 import optparse
24-import StringIO
25 from textwrap import dedent
26
27 import amqplib.client_0_8 as amqp
28@@ -28,21 +28,10 @@
29 import oops_amqp
30 import oops_datedir_repo
31
32-from oopstools.oops.helpers import parsedate, load_prefixes
33 from oopstools.oops.models import (
34 Oops,
35 parsed_oops_to_model_oops,
36- Prefix,
37- Report,
38 )
39-from oopstools.oops.oopsstore import OopsStore
40-from oopstools.oops import dbsummaries
41-from oopstools.oops.summaries import (
42- WebAppErrorSummary,
43- CheckwatchesErrorSummary,
44- CodeHostingWithRemoteSectionSummary,
45- GenericErrorSummary,
46-)
47
48
49 def main(argv=None):
50@@ -91,14 +80,23 @@
51 needed('password')
52 needed('vhost')
53 needed('queue')
54- connection = amqp.Connection(host=options.host, userid=options.username,
55+ factory = partial(
56+ amqp.Connection, host=options.host, userid=options.username,
57 password=options.password, virtual_host=options.vhost)
58- channel = connection.channel()
59 if options.bind_to:
60- channel.queue_declare(options.queue, durable=True, auto_delete=False)
61- channel.queue_bind(options.queue, options.bind_to)
62+ connection = factory()
63+ try:
64+ channel = connection.channel()
65+ try:
66+ channel.queue_declare(
67+ options.queue, durable=True, auto_delete=False)
68+ channel.queue_bind(options.queue, options.bind_to)
69+ finally:
70+ channel.close()
71+ finally:
72+ connection.close()
73 config = make_amqp_config(options.output)
74- receiver = oops_amqp.Receiver(config, channel, options.queue)
75+ receiver = oops_amqp.Receiver(config, factory, options.queue)
76 try:
77 receiver.run_forever()
78 except KeyboardInterrupt:
79
80=== modified file 'versions.cfg'
81--- versions.cfg 2011-10-16 22:35:01 +0000
82+++ versions.cfg 2011-10-18 04:22:22 +0000
83@@ -20,7 +20,7 @@
84 lazr.config = 1.1.3
85 mechanize = 0.1.11
86 oops = 0.0.9
87-oops-amqp = 0.0.1
88+oops-amqp = 0.0.2
89 oops-datedir-repo = 0.0.9
90 setuptools = 0.6c11
91 z3c.recipe.filetemplate = 2.0.3

Subscribers

People subscribed via source and target branches

to all changes: