Reviewed:  https://review.openstack.org/85374
Committed: 
https://git.openstack.org/cgit/openstack/cinder/commit/?id=01e5eac3f251164096051d43d763df72a65d31d3
Submitter: Jenkins
Branch:    milestone-proposed

commit 01e5eac3f251164096051d43d763df72a65d31d3
Author: Chris Buccella <bucce...@linux.vnet.ibm.com>
Date:   Thu Apr 3 04:02:45 2014 +0000

    _translate_from_glance() can cause an unnecessary HTTP request
    
    After returning from a get() call to python-glanceclient, cinder runs a
    translation function on the returned Image to get the data it wants. Part of
    this process is checking for an expected set of attributes, one of which is
    the deletion time ('deleted_at'). However, if the image has not been 
deleted,
    deleted_at key will not exist. This forces another call to glance to occur 
for
    the same image. A similar problem exists for the checksum attribute, which 
does
    not exist before an image is active. The fix here is to only consider
    deleted_at and checksum if they are expected to be present.
    
    This change was made in nova as change I67b7dd16
    
    Change-Id: Iedc16cb9316f9610fdb8ac03f448bc375a4e6bfa
    Closes-Bug: #1275173
    (cherry picked from commit da13c6285bb0aee55cfbc93f55ce2e2b7d6a28f2)


** Changed in: cinder
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1275173

Title:
  _translate_from_glance() can cause an unnecessary HTTP request

Status in Cinder:
  Fix Released
Status in OpenStack Compute (Nova):
  Fix Committed

Bug description:
  I noticed when performing a "nova image-show" on a current (not
  deleted) image, two HTTP requests were issued. Why isn't the Image
  retrieved on the first GET request?

  In fact, it is. The problem lies in _extract_attributes(), called by
  _translate_from_glance(). This function loops through a list of
  expected attributes, and extracts them from the passed-in Image. The
  problem is that if the attribute 'deleted' is False, there won't be a
  'deleted_at' attribute in the Image. Not finding the attribute results
  in getattr() making another GET request (to try to find the "missing"
  attribute?). This is unnecessary of course, since it makes sense for
  the Image to not have that attribute set.

To manage notifications about this bug go to:
https://bugs.launchpad.net/cinder/+bug/1275173/+subscriptions

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to