commit 8babd6a99014ccaf51d955769eaec085e037cc76
Author: Jay Pipes <email address hidden>
Date: Tue Mar 11 17:29:37 2014 -0400
Ensure is_image_available handles V2 Glance API
The V2 Glance API uses warlock to validate returned models
from calls such as GET /images/{id}. The get_locations() call in
the Nova Glance image driver was using the V2 Glance API call
to GET /images/{id} (which is correct, since image locations only
exist in the V2 API), but the GlanceImageService._is_image_available()
method was checking the is_public attribute of the supplied image model.
This caused warlock to throw an exception since is_public is not
an attribute on the V2 API's returned image model in glanceclient.
This change adds some checks that can handle both the V2 and V1 returned
image models from glanceclient and a bunch of unit tests to thoroughly
exercise the is_image_available method.
Reviewed: https:/ /review. openstack. org/79780 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=8babd6a9901 4ccaf51d955769e aec085e037cc76
Committed: https:/
Submitter: Jenkins
Branch: master
commit 8babd6a99014cca f51d955769eaec0 85e037cc76
Author: Jay Pipes <email address hidden>
Date: Tue Mar 11 17:29:37 2014 -0400
Ensure is_image_available handles V2 Glance API
The V2 Glance API uses warlock to validate returned models ice._is_ image_available ()
from calls such as GET /images/{id}. The get_locations() call in
the Nova Glance image driver was using the V2 Glance API call
to GET /images/{id} (which is correct, since image locations only
exist in the V2 API), but the GlanceImageServ
method was checking the is_public attribute of the supplied image model.
This caused warlock to throw an exception since is_public is not
an attribute on the V2 API's returned image model in glanceclient.
This change adds some checks that can handle both the V2 and V1 returned
image models from glanceclient and a bunch of unit tests to thoroughly
exercise the is_image_available method.
Change-Id: I35b5af8331c597 2bd89e1a674091f a2e3bde28a7
Closes-bug: #1291014