mistral-extra reports wrong endpoints

Bug #2064040 reported by Jay Jahns
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mistral
New
Undecided
Unassigned

Bug Description

In the get_endpoint_for_project function we retrieve the endpoint as listed in the catalog, but we do not perform any type of discover.

What happens is that when an action is ran with KeystoneAction for keystone.users_list, we end up crafting a URL of https://myurl:5000/users?

This returns a 404 error, because we're supposed to be using https://myurl:5000/v3/users?

It appears we do not perform any type of discovery in these tools. There are several other classes impacted by this.

Some classes actually run, if they don't need to do a version discovery. But a lot of them don't.

So far, I have only ran into this with KeystoneAction and DesignateAction, but there appear to be a lot more.

I believe we need to also perform a discovery before returning the endpoint back, so we have the correct versions sent back. Otherwise, these actions are DOA.

Revision history for this message
Jay Jahns (jayjahns) wrote :

Looking into this further, I am wondering why we are not using v3.token here. I made a modification to the get_session_and_auth function to just do 3 things:

    auth_url = ctx.auth_uri or CONF.keystone_authtoken.www_authenticate_uri
    auth = ks_token.Token(auth_url=auth_url, project_id=ctx.project_id, token=ctx.auth_token)
    session = ks_session.Session(auth=auth, verify=_determine_verify(ctx))

This includes importing v3.token from keystoneauth.

from keystoneauth1.identity.v3 import token as ks_token

Doing this, we no longer need to override endpoints when running actions. On the core projects I was able to execute all actions where we remove the need to do endpoint overrides.

Some of the other projects require a little more work, but we are not running into any issues with this modification. It however, invalidates all of the other items inside of the keystone.py under utils.

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.