Make token + endpoints work correctly
Change-Id: I3aa15cf2c3304c057fa22204475ac287de02e8eb
This commit is contained in:
parent
985f4c1eb6
commit
cdf87e7fca
@ -15,6 +15,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
from keystoneclient import adapter
|
from keystoneclient import adapter
|
||||||
from keystoneclient.auth.identity import generic
|
from keystoneclient.auth.identity import generic
|
||||||
|
from keystoneclient.auth import token_endpoint
|
||||||
from keystoneclient import session as ks_session
|
from keystoneclient import session as ks_session
|
||||||
from stevedore import extension
|
from stevedore import extension
|
||||||
|
|
||||||
@ -62,8 +63,11 @@ class Client(object):
|
|||||||
}
|
}
|
||||||
|
|
||||||
if token:
|
if token:
|
||||||
auth_args['token'] = token
|
# To mimic typical v1 behaviour I copied this
|
||||||
session.auth = generic.Token(**auth_args)
|
endpoint = endpoint.rstrip('/')
|
||||||
|
if not endpoint.endswith('v1'):
|
||||||
|
endpoint = "%s/v1" % endpoint
|
||||||
|
session.auth = token_endpoint.Token(endpoint, token)
|
||||||
else:
|
else:
|
||||||
password_args = {
|
password_args = {
|
||||||
'username': username,
|
'username': username,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user