keystoneclient package: include interface parameter in example

Bug #1922231 reported by TWENTY |20
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-keystoneclient
New
Undecided
Unassigned

Bug Description

I tried accessing our keystone API via python-keystoneclient.
From my network I don't have access to the internal or admin interface.
By default, the admin interface is used (cf. https://bugs.launchpad.net/python-keystoneclient/+bug/1457702).

The connection was set up like this:
    password_method = v3.PasswordMethod(username='username',
                                        password='password',
                                        user_domain_name='username')

    keystone_auth = v3.Auth(auth_url='https://myurl:5000/v3',
                            auth_methods=[password_method],
                            project_id='1234',
                            project_name='projectname',
                            project_domain_name='mydomain',
                            project_domain_id='4321')

    sess = session.Session(auth=keystone_auth)
    keystone = keystoneclient.client.Client(session=sess)

Trying to access any data gives me an exception as such:
keystoneauth1.exceptions.connection.ConnectFailure: Unable to establish connection to https://keystone-internalapi.myurl:35357/v3/domains

Which, of course, is the expected behaviour.

It took me a lot of time to find the documentation which then mentions the interface parameter:
https://docs.openstack.org/python-keystoneclient/latest/api/keystoneclient.html#keystoneclient.httpclient.HTTPClient

So you're supposed to use it like this:
    keystone = keystoneclient.client.Client(session=sess, interface='public')

This parameter seems very common to me and I have seen others stumble over it. Therefore I would suggest to include an example for it on one of the following pages:
https://docs.openstack.org/python-keystoneclient/latest/using-sessions.html
https://pypi.org/project/python-keystoneclient/
https://github.com/openstack/python-keystoneclient

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.