Skip to content

Commit

Permalink
Make token + endpoints work correctly
Browse files Browse the repository at this point in the history
Change-Id: I3aa15cf2c3304c057fa22204475ac287de02e8eb
  • Loading branch information
Endre Karlson committed Nov 14, 2014
1 parent 985f4c1 commit cdf87e7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions designateclient/v1/__init__.py
Expand Up @@ -15,6 +15,7 @@
# under the License.
from keystoneclient import adapter
from keystoneclient.auth.identity import generic
from keystoneclient.auth import token_endpoint
from keystoneclient import session as ks_session
from stevedore import extension

Expand Down Expand Up @@ -62,8 +63,11 @@ def __init__(self, endpoint=None, username=None, user_id=None,
}

if token:
auth_args['token'] = token
session.auth = generic.Token(**auth_args)
# To mimic typical v1 behaviour I copied this
endpoint = endpoint.rstrip('/')
if not endpoint.endswith('v1'):
endpoint = "%s/v1" % endpoint
session.auth = token_endpoint.Token(endpoint, token)
else:
password_args = {
'username': username,
Expand Down

0 comments on commit cdf87e7

Please sign in to comment.