Select a specific identity endpoint

asked 2019-02-07 03:24:56 -0500

anonymous user

Anonymous

updated 2019-02-08 03:23:54 -0500

Hi,

I have an openstack (queen version) configured with three endpoints for the service keystone/identity ( public, admin, internal ).

I'am using python-openstackclient (3.17.0) to access the id of the service placement: => servicekeystone.services.find(name='placement').id

My code is accessing openstack from a computer that have only access to the public url and my code use either admin or internal:

2019-02-07 08:17:40,786 [17705] DEBUG    urllib3.connectionpool: Starting new HTTP connection (1): 172.29.240.21:35357
2019-02-07 08:19:50,288 [17705] WARNING  keystoneauth.discover: Failed to contact the endpoint at http://172.29.240.21:35357 for discovery. Fallback to using that endpoint as the base url.
2019-02-07 08:19:50,288 [17705] DEBUG    keystoneauth.session: REQ: curl -g -i --insecure -X GET http://172.29.240.21:35357/services?name=placement -H "Accept: application/json" -H "User-Agent: python-keystoneclient" -H "X-Auth-Token: {SHA256}9a6c42ffqsdfqsdfqbh5464535d2026234a5553413dfqsdfdgdfqdgq9c5216febd35192727141"
2019-02-07 08:19:50,292 [17705] DEBUG    urllib3.connectionpool: Starting new HTTP connection (2): 172.29.240.21:35357
2019-02-07 08:22:01,360 [17705] ERROR    flask.app: Exception on /v1/compute_resources/capacities/query [POST]

The keystone user I am using is only member.

Is it possible to force my code to use the public admin instead of the internal/admin ?

Best regards.


EDIT 1:

I did some digging in the source code of python-keystoneclient.

In this file: vi releasenotes/notes/ksc_2.1.0-739ded9c4c3f8aaa.yaml [bug 1457702 <https://bugs.launchpad.net/python-keystoneclient/+bug/1457702>_] Change default endpoint to public for keystone v3.

That's what I need. And when I compared the commit witch my version of python-keystoneclient https://git.openstack.org/cgit/openst...

I realized that the line: kwargs.setdefault('interface', 'public') has disappeared.

With a git blame on the client.py file, I have discovered some other lines about endpoints that are not around anymore.

I read this post : https://ask.openstack.org/en/question...

And setting the default endpoint for a user could be a solution. But I found no cli command in my openstack-client to do so.

This post is also around 2015, so my guess is that things have evolved but I have no idea why and how to solve my problem.

edit retag flag offensive close merge delete