Merge lp:~joetalbott/snappy-proposed-image-builder/rename_queues into lp:snappy-proposed-image-builder

Proposed by Joe Talbott
Status: Merged
Approved by: Joe Talbott
Approved revision: 5
Merged at revision: 6
Proposed branch: lp:~joetalbott/snappy-proposed-image-builder/rename_queues
Merge into: lp:snappy-proposed-image-builder
Diff against target: 46 lines (+10/-6)
3 files modified
core_image_builder/__init__.py (+2/-3)
core_image_builder/constants.py (+7/-0)
core_image_builder/queue.py (+1/-3)
To merge this branch: bzr merge lp:~joetalbott/snappy-proposed-image-builder/rename_queues
Reviewer Review Type Date Requested Status
Francis Ginther Approve
Paul Larson Approve
Review via email: mp+260293@code.launchpad.net

Commit message

Rename queues to match convention and move to constants.

Description of the change

Rename queues to match convention and move to constants.

To post a comment you must log in.
Revision history for this message
Paul Larson (pwlars) wrote :

This one seems to be just about queue names. Is there another one for all the other bits?
One suggestion below, but not a blocker for me. Otherwise +1

review: Approve
Revision history for this message
Francis Ginther (fginther) wrote :

This matches the naming proposal AFIACT. Also interesting approach of using a table.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'core_image_builder/__init__.py'
2--- core_image_builder/__init__.py 2015-05-21 19:00:39 +0000
3+++ core_image_builder/__init__.py 2015-05-27 13:40:52 +0000
4@@ -70,11 +70,10 @@
5 builder = CoreImageBuilder(connection)
6 retry_policy = DefaultRetryPolicy(
7 max_retries=3,
8- dead_queue='core.deadletters.{}'.format(constants.API_VERSION)
9+ dead_queue=constants.QUEUES['deadletters']
10 )
11 monitor = SimpleRabbitQueueWorker(
12- connection,
13- 'core.package.{}'.format(constants.API_VERSION),
14+ connection, constants.QUEUES['packages'],
15 worker.ImageBuilderWorker(config, builder),
16 retry_policy,
17 )
18
19=== modified file 'core_image_builder/constants.py'
20--- core_image_builder/constants.py 2015-05-19 21:37:40 +0000
21+++ core_image_builder/constants.py 2015-05-27 13:40:52 +0000
22@@ -52,3 +52,10 @@
23 'service': SERVICE_NAME,
24 'hostname': HOSTNAME,
25 }
26+
27+QUEUE_PREFIX = 'snappy-proposed'
28+QUEUES = {
29+ 'deadletters': '{}.deadletters.{}'.format(QUEUE_PREFIX, API_VERSION),
30+ 'packages': '{}.packages.{}'.format(QUEUE_PREFIX, API_VERSION),
31+ 'tests': '{}.tests.{}'.format(QUEUE_PREFIX, API_VERSION),
32+}
33
34=== modified file 'core_image_builder/queue.py'
35--- core_image_builder/queue.py 2015-05-21 19:00:39 +0000
36+++ core_image_builder/queue.py 2015-05-27 13:40:52 +0000
37@@ -53,8 +53,6 @@
38
39 def __call__(self, payload):
40 """Take 'payload' and enqueue it on the rabbit queue."""
41- queue = self.connection.SimpleQueue(
42- "core.tests.{}".format(constants.API_VERSION)
43- )
44+ queue = self.connection.SimpleQueue(constants.QUEUES['tests'])
45 queue.put(payload)
46 queue.close()

Subscribers

People subscribed via source and target branches