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

Proposed by Francis Ginther
Status: Merged
Approved by: Francis Ginther
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
Celso Providelo (community) Approve
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.
Revision history for this message
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

Don't use 'format' for logger calls.

Revision history for this message
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.

Revision history for this message
Para Siva (psivaa) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'core_image_publisher/worker.py'
--- core_image_publisher/worker.py 2015-03-31 20:21:41 +0000
+++ core_image_publisher/worker.py 2015-04-01 02:49:15 +0000
@@ -141,6 +141,7 @@
141 """141 """
142 Upload the nova image to glance, returning the id of the image in glance.142 Upload the nova image to glance, returning the id of the image in glance.
143 """143 """
144 extra = LOGGING_EXTRA.copy()
144 glance = get_glance_client(config)145 glance = get_glance_client(config)
145 image_name = os.path.basename(nova_image_path)146 image_name = os.path.basename(nova_image_path)
146 image = glance.images.create(147 image = glance.images.create(
@@ -149,4 +150,5 @@
149 disk_format='qcow2',150 disk_format='qcow2',
150 container_format='bare',151 container_format='bare',
151 )152 )
153 logger.info("Uploaded %s with ID %s.", image_name, image.id, extra=extra)
152 return image.id154 return image.id

Subscribers

People subscribed via source and target branches