Add note re: GlanceTest function

This commit is contained in:
Alex Kavanagh
2019-10-07 23:06:22 +01:00
parent 81c4432136
commit b33afe9cb3

View File

@@ -522,6 +522,10 @@ class GlanceTests(BasePolicydSpecialization):
glance_client = openstack_utils.get_glance_session_client(
self.get_keystone_session_demo_user(ip))
try:
# NOTE(ajkavanagh) - it turns out that the list() is very important
# as it forces the generator to iterate which only then checkes if
# the api call is authorized. Just getting the generator (from
# .list()) doesn't perform the API call.
images = list(glance_client.images.list())
logging.debug("images is: {}".format(images))
except glanceclient.common.exceptions.HTTPForbidden: