Merge lp:~thomir-deactivatedaccount/autopkgtest-result-checker/snappy-proposed-migration-fix-queue-names into lp:autopkgtest-result-checker/snappy-proposed-migration

Proposed by Thomi Richards
Status: Merged
Approved by: Thomi Richards
Approved revision: 17
Merged at revision: 17
Proposed branch: lp:~thomir-deactivatedaccount/autopkgtest-result-checker/snappy-proposed-migration-fix-queue-names
Merge into: lp:autopkgtest-result-checker/snappy-proposed-migration
Diff against target: 83 lines (+27/-15)
2 files modified
core_result_checker/__init__.py (+17/-5)
core_result_checker/constants.py (+10/-10)
To merge this branch: bzr merge lp:~thomir-deactivatedaccount/autopkgtest-result-checker/snappy-proposed-migration-fix-queue-names
Reviewer Review Type Date Requested Status
Kit Randel (community) code Approve
Review via email: mp+260074@code.launchpad.net

Commit message

Update queue & exchange names, fix a few lint issues.

Description of the change

Update queue & exchange names, fix a few lint issues.

To post a comment you must log in.
Revision history for this message
Kit Randel (blr) wrote :

Lacking some context, but looks correct.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'core_result_checker/__init__.py'
--- core_result_checker/__init__.py 2015-05-21 01:53:57 +0000
+++ core_result_checker/__init__.py 2015-05-25 21:25:00 +0000
@@ -23,6 +23,7 @@
23import os23import os
2424
25import kombu25import kombu
26from kombu.pools import producers
26from swiftclient.service import SwiftService27from swiftclient.service import SwiftService
27from uservice_utils.logging import (28from uservice_utils.logging import (
28 configure_service_logging,29 configure_service_logging,
@@ -221,9 +222,20 @@
221222
222223
223def insert_payload_into_queue(connection, queue, payload):224def insert_payload_into_queue(connection, queue, payload):
224 q = connection.SimpleQueue(queue)225 q = connection.SimpleQueue(queue)
225 q.put(payload)226 q.put(payload)
226 q.close()227 q.close()
228
229
230def insert_payload_into_fanout_exchange(connection, exchange_name, payload):
231 with producers[connection].acquire(block=True) as producer:
232 publisher = connection.ensure(
233 producer,
234 producer.publish,
235 max_retries=3
236 )
237 exchange = kombu.Exchange(exchange_name, type="fanout")
238 publisher(payload, exchange=exchange, declare=[exchange])
227239
228240
229def main():241def main():
@@ -258,9 +270,9 @@
258 constants.INPUT_QUEUE270 constants.INPUT_QUEUE
259 )271 )
260 complete_payload = partial(272 complete_payload = partial(
261 insert_payload_into_queue,273 insert_payload_into_fanout_exchange,
262 connection,274 connection,
263 constants.DONE_QUEUE275 constants.DONE_EXCHANGE,
264 )276 )
265 queue_manager = QueueManager(277 queue_manager = QueueManager(
266 retry_payload,278 retry_payload,
267279
=== modified file 'core_result_checker/constants.py'
--- core_result_checker/constants.py 2015-05-21 01:44:53 +0000
+++ core_result_checker/constants.py 2015-05-25 21:25:00 +0000
@@ -20,21 +20,21 @@
20# Queue names are constant, rather than being defined in the config.20# Queue names are constant, rather than being defined in the config.
2121
22# The queue we listen to for new payloads to check:22# The queue we listen to for new payloads to check:
23INPUT_QUEUE = "core.result.v1"23INPUT_QUEUE = "snappy-proposed-migration.result"
2424
25# The queue we put fatally error'd payloads into:25# The queue we put fatally error'd payloads into:
26DEAD_LETTER_QUEUE = "core.deadletters.v1"26DEAD_LETTER_QUEUE = "core.deadletters.v1"
2727
28# The queue we put payloads on to re-run the test:28# The queue we put payloads on to re-run the test:
29TEST_RETRY_QUEUE = "core.tests.v1"29TEST_RETRY_QUEUE = "snappy-proposed-migration.package"
3030
31# The queue we put results on:31# The exchange we put results on:
32DONE_QUEUE = "pm.results"32DONE_EXCHANGE = "results.exchange"
3333
3434
35SOLUTION_NAME = "core-image-testing"35SOLUTION_NAME = "snappy-proposed-migration"
3636
37SERVICE_NAME = "core-result-checker"37SERVICE_NAME = "result-checker"
3838
3939
40def _get_hostname():40def _get_hostname():

Subscribers

People subscribed via source and target branches

to all changes: