Merge lp:~thomir-deactivatedaccount/core-image-watcher/trunk-use-request-id into lp:core-image-watcher

Proposed by Thomi Richards
Status: Merged
Approved by: Thomi Richards
Approved revision: 17
Merged at revision: 16
Proposed branch: lp:~thomir-deactivatedaccount/core-image-watcher/trunk-use-request-id
Merge into: lp:core-image-watcher
Diff against target: 57 lines (+18/-4)
2 files modified
core_image_watcher/__init__.py (+2/-0)
core_image_watcher/tests/test_image_watcher.py (+16/-4)
To merge this branch: bzr merge lp:~thomir-deactivatedaccount/core-image-watcher/trunk-use-request-id
Reviewer Review Type Date Requested Status
Celso Providelo (community) Approve
Review via email: mp+255451@code.launchpad.net

Commit message

Add the request_id payload key.

Description of the change

Create and return a uuid in the request payload.

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

Let's use the kombu UUIDv4 accessor for peace of mind here.

I will pre-approved it because I probably won't be here when you come from lunch.

review: Approve
17. By Thomi Richards

Use kombu uuid.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'core_image_watcher/__init__.py'
--- core_image_watcher/__init__.py 2015-04-03 02:05:16 +0000
+++ core_image_watcher/__init__.py 2015-04-08 01:59:17 +0000
@@ -25,6 +25,7 @@
25import time25import time
2626
27import kombu27import kombu
28from kombu.common import uuid
28from uservice_utils.logging import configure_service_logging29from uservice_utils.logging import configure_service_logging
2930
30from core_image_watcher import constants31from core_image_watcher import constants
@@ -128,6 +129,7 @@
128 'image_name': latest_version,129 'image_name': latest_version,
129 'channel': channel,130 'channel': channel,
130 'device': device,131 'device': device,
132 'request_id': uuid(),
131 }133 }
132 return body134 return body
133135
134136
=== modified file 'core_image_watcher/tests/test_image_watcher.py'
--- core_image_watcher/tests/test_image_watcher.py 2015-03-26 20:44:05 +0000
+++ core_image_watcher/tests/test_image_watcher.py 2015-04-08 01:59:17 +0000
@@ -16,6 +16,11 @@
16import os16import os
17import tempfile17import tempfile
18import testtools18import testtools
19from testtools.matchers import (
20 Equals,
21 MatchesDict,
22 NotEquals,
23)
1924
20from core_image_watcher import (25from core_image_watcher import (
21 _cache_version_to_disk,26 _cache_version_to_disk,
@@ -90,10 +95,17 @@
90 'fakedevice',95 'fakedevice',
91 _get_latest_image_version,96 _get_latest_image_version,
92 _cache_version_to_disk)97 _cache_version_to_disk)
93 self.assertEqual(body,98 self.assertThat(
94 {'device': 'fakedevice',99 body,
95 'image_name': '100',100 MatchesDict(
96 'channel': 'fakechannel'})101 {
102 'device': Equals('fakedevice'),
103 'image_name': Equals('100'),
104 'channel': Equals('fakechannel'),
105 'request_id': NotEquals(''),
106 }
107 )
108 )
97109
98 def test_check_for_no_new_image(self):110 def test_check_for_no_new_image(self):
99 def _get_latest_image_version(channel, device):111 def _get_latest_image_version(channel, device):

Subscribers

People subscribed via source and target branches

to all changes: