← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1275173] [NEW] _translate_from_glance() can cause an unnecessary HTTP request

 

Public bug reported:

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.

** Affects: nova
     Importance: Undecided
         Status: New

-- 
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 OpenStack Compute (Nova):
  New

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/nova/+bug/1275173/+subscriptions


Follow ups

References