Merge lp:~thomir-deactivatedaccount/core-image-publisher/fix-logger into lp:core-image-publisher

Proposed by Thomi Richards
Status: Merged
Approved by: Celso Providelo
Approved revision: 10
Merged at revision: 11
Proposed branch: lp:~thomir-deactivatedaccount/core-image-publisher/fix-logger
Merge into: lp:core-image-publisher
Diff against target: 29 lines (+4/-2)
1 file modified
core_image_publisher/worker.py (+4/-2)
To merge this branch: bzr merge lp:~thomir-deactivatedaccount/core-image-publisher/fix-logger
Reviewer Review Type Date Requested Status
Celso Providelo (community) Approve
Review via email: mp+254352@code.launchpad.net

This proposal supersedes a proposal from 2015-03-27.

Commit message

Some fixes for logging.

Description of the change

Some fixes for logging

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

As discussed on IRC you verified that msg.reject() behaves exactly as msg.requeue() when there are no DLX configured for the queue, so the message goes back to the queue, which is the intended behaviour for now.

[]

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'core_image_publisher/worker.py'
2--- core_image_publisher/worker.py 2015-03-26 22:26:21 +0000
3+++ core_image_publisher/worker.py 2015-03-27 04:47:47 +0000
4@@ -17,8 +17,11 @@
5
6 """Business logic or the service lives here."""
7
8+import logging
9 from core_image_publisher.queue import enqueue_message
10
11+logger = logging.getLogger(__name__)
12+
13
14 def logging_worker(message):
15 logger.info("Got %r", message.payload, extra=message.payload)
16@@ -30,7 +33,7 @@
17 except KeyError as e:
18 logger.error(
19 "Unable to deserialize message payload - rejecting message: %s",
20- s,
21+ e,
22 extra=payload
23 )
24 message.reject()
25@@ -55,4 +58,3 @@
26
27 def upload_image_to_glance(nova_image_path):
28 """Upload the nova image to glance, returning the name of the image in glance."""
29-

Subscribers

People subscribed via source and target branches

to all changes: