Skip to content

Commit

Permalink
Add note re: GlanceTest function
Browse files Browse the repository at this point in the history
  • Loading branch information
ajkavanagh committed Oct 7, 2019
1 parent 81c4432 commit b33afe9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions zaza/openstack/charm_tests/policyd/tests.py
Expand Up @@ -522,6 +522,10 @@ def get_client_and_attempt_operation(self, ip):
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:
Expand Down

0 comments on commit b33afe9

Please sign in to comment.