Make sahara_image context glance v2 compatible

Change-Id: I363d4ddfbeed42bb19bc1708ce858e1340613bd6
This commit is contained in:
Chris St. Pierre 2016-05-31 11:22:59 -05:00
parent 2a8367e75d
commit a892daf476

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