[openstack-dev] [keystone] keystoneclient.client.v3.Client: extract identity endpoint

Johannes Grassler jgrassler at suse.de
Fri Oct 14 09:39:33 UTC 2016


Hello,

On 10/14/2016 02:27 AM, Jamie Lennox wrote:
> On 13 October 2016 at 23:19, Johannes Grassler <jgrassler at suse.de> wrote:
[Is there a canonical way to extract the identity URL being used by python-keystoneclient?]
[...]
>>   keystone_service=client.services.list(type='identity')[0]
>>   client.endpoints.list(service=keystone_service,
>>                         interface='admin',
>>                         region=client.region_name)
>>
>> ...but that feels rather dirty since it independently looks up the
>> admin endpoint rather than plucking the identity endpoint from the
>> keystone client instance.
[...]
> From the session you can do:
>
> session.get_endpoint(service_type='identity', interface='admin',
> region='region')
>
> to get the URL from the catalog.

Ok, that is at least a little more elegant. Thank you!

Cheers,

Johannes

-- 
Johannes Grassler, Cloud Developer
SUSE Linux GmbH, HRB 21284 (AG Nürnberg)
GF: Felix Imendörffer, Jane Smithard, Graham Norton
Maxfeldstr. 5, 90409 Nürnberg, Germany



More information about the OpenStack-dev mailing list