Merge "Make sahara_image context glance v2 compatible"

This commit is contained in:
Jenkins 2016-06-03 02:53:08 +00:00 committed by Gerrit Code Review
commit a9fb338cc8

View File

@ -92,7 +92,13 @@ class SaharaImage(context.Context):
image = clients.glance().images.get(image_uuid)
if not image.is_public:
visibility = None
if hasattr(image, "is_public"):
visibility = "public" if image.is_public else "private"
else:
visibility = image["visibility"]
if visibility != "public":
raise exceptions.BenchmarkSetupFailure(
"Image provided in the Sahara context should be public.")
image_id = image_uuid