Merge lp:~pwlars/snappy-proposed-selftest-agent/publish-direct-results-exchange into lp:snappy-proposed-selftest-agent

Proposed by Paul Larson
Status: Merged
Merged at revision: 9
Proposed branch: lp:~pwlars/snappy-proposed-selftest-agent/publish-direct-results-exchange
Merge into: lp:snappy-proposed-selftest-agent
Diff against target: 46 lines (+10/-5)
2 files modified
snappy_proposed_selftest_agent/__init__.py (+10/-4)
snappy_proposed_selftest_agent/constants.py (+0/-1)
To merge this branch: bzr merge lp:~pwlars/snappy-proposed-selftest-agent/publish-direct-results-exchange
Reviewer Review Type Date Requested Status
Celso Providelo (community) Approve
Review via email: mp+260417@code.launchpad.net

Commit message

Eliminate RESULTS_QUEUE

Description of the change

Thanks to cprov for pointing out that we can do this. Now the bogus queue is no longer needed for publishing to the results exchange!

To post a comment you must log in.
Revision history for this message
Celso Providelo (cprov) wrote :

Thank you, Paul.

review: Approve
Revision history for this message
Ubuntu CI Bot (uci-bot) wrote :
Download full text (6.2 KiB)

The attempt to merge lp:~pwlars/snappy-proposed-selftest-agent/publish-direct-results-exchange into lp:snappy-proposed-selftest-agent failed. Below is the output from the failed tests.

Using base prefix '/usr'
New python executable in /tmp/venv-snappy-proposed-selftest-agent4imbz5zi/bin/python3
Also creating executable in /tmp/venv-snappy-proposed-selftest-agent4imbz5zi/bin/python
Installing setuptools, pip...done.
Running virtualenv with interpreter /usr/bin/python3
Ignoring indexes: https://pypi.python.org/simple/
Downloading/unpacking kombu==3.0.24 (from -r requirements.txt (line 1))
Downloading/unpacking python-logstash==0.4.2 (from -r requirements.txt (line 2))
  Running setup.py (path:/tmp/venv-snappy-proposed-selftest-agent4imbz5zi/build/python-logstash/setup.py) egg_info for package python-logstash

Downloading/unpacking uservice-utils==1.0.2.1 (from -r requirements.txt (line 3))
Downloading/unpacking amqp>=1.4.5,<2.0 (from kombu==3.0.24->-r requirements.txt (line 1))
  Running setup.py (path:/tmp/venv-snappy-proposed-selftest-agent4imbz5zi/build/amqp/setup.py) egg_info for package amqp

Downloading/unpacking anyjson>=0.3.3 (from kombu==3.0.24->-r requirements.txt (line 1))
  Running setup.py (path:/tmp/venv-snappy-proposed-selftest-agent4imbz5zi/build/anyjson/setup.py) egg_info for package anyjson

Installing collected packages: kombu, python-logstash, uservice-utils, amqp, anyjson
  Running setup.py install for python-logstash

  Running setup.py install for amqp

  Running setup.py install for anyjson
    Fixing build/lib/anyjson/__init__.py
    Skipping implicit fixer: buffer
    Skipping implicit fixer: idioms
    Skipping implicit fixer: set_literal
    Skipping implicit fixer: ws_comma
    Fixing build/lib/anyjson/__init__.py
    Skipping implicit fixer: buffer
    Skipping implicit fixer: idioms
    Skipping implicit fixer: set_literal
    Skipping implicit fixer: ws_comma

Successfully installed kombu python-logstash uservice-utils amqp anyjson
Cleaning up...
Downloading/unpacking flake8==2.4.0 (from -r test_requirements.txt (line 1))
  Downloading flake8-2.4.0-py2.py3-none-any.whl
Downloading/unpacking testtools==1.7.1 (from -r test_requirements.txt (line 2))
Downloading/unpacking pyflakes>=0.8.1,<0.9 (from flake8==2.4.0->-r test_requirements.txt (line 1))
  Downloading pyflakes-0.8.1-py2.py3-none-any.whl
Downloading/unpacking pep8>=1.5.7,<1.6 (from flake8==2.4.0->-r test_requirements.txt (line 1))
  Downloading pep8-1.5.7-py2.py3-none-any.whl
Downloading/unpacking mccabe>=0.2.1,<0.4 (from flake8==2.4.0->-r test_requirements.txt (line 1))
  Downloading mccabe-0.3-py2.py3-none-any.whl
Downloading/unpacking extras (from testtools==1.7.1->-r test_requirements.txt (line 2))
  Downloading extras-0.0.3.tar.gz
  Running setup.py (path:/tmp/venv-snappy-proposed-selftest-agent4imbz5zi/build/extras/setup.py) egg_info for package extras

Downloading/unpacking unittest2>=1.0.0 (from testtools==1.7.1->-r test_requirements.txt (line 2))
Downloading/unpacking python-mimeparse (from testtools==1.7.1->-r test_requirements.txt (line 2))
  Downloading python-mimeparse-0.1.4.tar.gz
  Running setup.py (path:/tmp/venv...

Read more...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'snappy_proposed_selftest_agent/__init__.py'
2--- snappy_proposed_selftest_agent/__init__.py 2015-05-28 03:50:20 +0000
3+++ snappy_proposed_selftest_agent/__init__.py 2015-05-28 04:10:51 +0000
4@@ -21,6 +21,8 @@
5 import logging
6 import os
7
8+from kombu.pools import producers
9+
10 from uservice_utils.logging import (
11 configure_service_logging,
12 ExtraLogger,
13@@ -41,13 +43,17 @@
14 self.connection = connection
15 exchange = kombu.Exchange(constants.RESULTS_EXCHANGE,
16 type='fanout', durable=False)
17- self.queue = kombu.Queue(constants.RESULTS_QUEUE, exchange)
18
19 def __call__(self, payload):
20 """Take 'payload' and enqueue it on the rabbit exchange."""
21- queue = self.connection.SimpleQueue(self.queue)
22- queue.put(payload)
23- queue.close()
24+ with producers[self.connection].acquire(block=True) as producer:
25+ publisher = self.connection.ensure(
26+ producer,
27+ producer.publish,
28+ max_retries=3
29+ )
30+ exchange = self.exchange
31+ publisher(payload, exchange=exchange, declare=[exchange])
32
33
34 class CoreImageBuilder(object):
35
36=== modified file 'snappy_proposed_selftest_agent/constants.py'
37--- snappy_proposed_selftest_agent/constants.py 2015-05-28 03:54:01 +0000
38+++ snappy_proposed_selftest_agent/constants.py 2015-05-28 04:10:51 +0000
39@@ -31,7 +31,6 @@
40
41 # We need to notify the results exchange that the test is in progress
42 RESULTS_EXCHANGE = "results.exchange.v1"
43-RESULTS_QUEUE = "snappy-proposed.selftest.results"
44
45 # The queue we put fatally error'd payloads into:
46 DEAD_LETTER_QUEUE = "snappy-proposed.deadletters.v1"

Subscribers

People subscribed via source and target branches