Merge lp:~fginther/core-image-publisher/log-image-name-to-id into lp:core-image-publisher

Proposed by Francis Ginther on 2015-04-01
Status: Merged
Approved by: Francis Ginther on 2015-04-02
Approved revision: 22
Merged at revision: 24
Proposed branch: lp:~fginther/core-image-publisher/log-image-name-to-id
Merge into: lp:core-image-publisher
Diff against target: 17 lines (+2/-0)
1 file modified
core_image_publisher/worker.py (+2/-0)
To merge this branch: bzr merge lp:~fginther/core-image-publisher/log-image-name-to-id
Reviewer Review Type Date Requested Status
Para Siva (community) Approve on 2015-04-02
Celso Providelo (community) 2015-04-01 Approve on 2015-04-01
Review via email: mp+254861@code.launchpad.net

Commit message

Add log message to associate glance image id with the image name.

Description of the change

Add log message to associate glance image id with the image name.

The message will look like:

2015-04-01 02:23:43,213 core_image_publisher.worker INFO: Uploaded core-355-cloud.img with ID 04abecd8-ee7f-4b56-9b07-0f171439f44b.

To post a comment you must log in.
Celso Providelo (cprov) wrote :

Francis,

It looks fine, but I don't really know why we need such association if "--image <image_id>" should work fine in adt-run.

Perhaps it will be useful for tracing problems, it does not hurt at all.

[]

review: Approve
22. By Francis Ginther on 2015-04-01

Don't use 'format' for logger calls.

Francis Ginther (fginther) wrote :

> Francis,
>
> It looks fine, but I don't really know why we need such association if "--
> image <image_id>" should work fine in adt-run.
>
> Perhaps it will be useful for tracing problems, it does not hurt at all.
>
> []

Right, it was basically a case of the image id being too opaque. It would still be possible to match up an image id to the original image it represents, but this gives a definitive message to search upon.

Para Siva (psivaa) wrote :

+1

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-31 20:21:41 +0000
3+++ core_image_publisher/worker.py 2015-04-01 02:49:15 +0000
4@@ -141,6 +141,7 @@
5 """
6 Upload the nova image to glance, returning the id of the image in glance.
7 """
8+ extra = LOGGING_EXTRA.copy()
9 glance = get_glance_client(config)
10 image_name = os.path.basename(nova_image_path)
11 image = glance.images.create(
12@@ -149,4 +150,5 @@
13 disk_format='qcow2',
14 container_format='bare',
15 )
16+ logger.info("Uploaded %s with ID %s.", image_name, image.id, extra=extra)
17 return image.id

Subscribers

People subscribed via source and target branches