Code review comment for lp://staging/~thedac/charm-helpers/get-catalog

Revision history for this message
Alex Kavanagh (ajkavanagh) wrote :

Unless something has changed, and it may well have done, then this is in response to https://bugs.launchpad.net/python-keystoneclient/+bug/1547331 which is about v3 keystone client having the missing service_catalog?

If so, the get_access() method forces a pre-auth and if placed on the keystone client, will then get the service catalog:

e.g.

    auth = keystoneclient.auth.identity.v3.Password(...)
    sess = keystoneclient.session.Session(auth=auth)
    keystone = keystone.v3.client.Client(session=sess)
    keystone.auth_ref = auth.get_access(sess)

At this point the keystone variable can be used to get the catalog:

    keystone.service_catalog.get_endpoints()

This works (for v3) as it is in the Barbican charm's keystone v3 code. It's also backwards compatible with the v2_0 client if v2.Password(...) is used.

See https://github.com/openstack/charm-barbican/blob/master/src/tests/basic_deployment.py#L142 as an example?

However, if this isn't the use case, then sorry for the interruption!

« Back to merge proposal