Reviewed: https://review.openstack.org/460280 Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=94306a686b504abfca3fa36e9cd22b05c385a329 Submitter: Jenkins Branch: master
commit 94306a686b504abfca3fa36e9cd22b05c385a329 Author: Pengju Jiao <[email protected]> Date: Thu Apr 27 03:02:25 2017 +0800 Fix glance image-download error When use command 'glance image-download --file xxx.raw <image-id>' to download the image, it will fail with error code 500. It shows "TypeError:'ImageTarget' object does not support item assignment" in glance-api's log. It is because that when instance snapshot of volume-backed instance is uploaded to glance, image size is set to 0 from nova. While downloading that snapshot with using image-download call it tries to get the image size from the cache where it fails as image is instance of policy.ImageTarget. Made change to set image size on image_meta.target if image is a policy.ImageTarget. Change-Id: I1a08baa465d3927b721678a5a7ab5f54304993d6 Co-Authored-By: Abhishek Kekane <[email protected]> Co-Authored-By: Eric Fried <[email protected]> Closes-Bug: #1686488 ** Changed in: glance Status: In Progress => Fix Released -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to Glance. https://bugs.launchpad.net/bugs/1686488 Title: glance image-download error Status in Glance: Fix Released Bug description: When use command ' glance image-download --file xxx.raw <image-id>' to download the image, it will fail with error code 500. glance-api log info as below: File "/opt/stack/glance/glance/common/wsgi.py", line 794, in __call__ response = self.process_request(req) File "/opt/stack/glance/glance/api/middleware/cache.py", line 180, in process_request return method(request, image_id, image_iterator, image_metadata) File "/opt/stack/glance/glance/api/middleware/cache.py", line 235, in _process_v2_request self._verify_metadata(image_meta) File "/opt/stack/glance/glance/api/middleware/cache.py", line 75, in _verify_metadata image_meta['size'] = self.cache.get_image_size(image_meta['id']) TypeError: 'ImageTarget' object does not support item assignment This should be fixed. To manage notifications about this bug go to: https://bugs.launchpad.net/glance/+bug/1686488/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : [email protected] Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp

