Remove unexpected kwargs when authenticating using token

Current implementation of token auth in CLI doesn't work at all.
_get_keystone_auth() is handling all types of authentication and gets
a superset of all possible inputs as kwargs.
Token authentication doesn't expect some of the arguments which results
in "__init__() got an unexpected keyword argument" errors.

This change keeps the "facade" function but passes only parameters
which are expected by Token() constructor.

Change-Id: Ib71ce1523f60df340c3b939f646c5b33bf0b146d
Closes-Bug: #1545187
This commit is contained in:
Jacek Tomasiak 2016-02-12 23:41:46 +01:00 committed by Serg Melikyan
parent 84c08e0d17
commit a9dd96e4c8
1 changed files with 7 additions and 1 deletions

View File

@ -246,7 +246,13 @@ class MuranoShell(object):
def _get_keystone_auth(self, session, auth_url, **kwargs):
auth_token = kwargs.pop('auth_token', None)
if auth_token:
return token.Token(auth_url, auth_token, **kwargs)
return token.Token(
auth_url,
auth_token,
project_id=kwargs.pop('project_id'),
project_name=kwargs.pop('project_name'),
project_domain_id=kwargs.pop('project_domain_id'),
project_domain_name=kwargs.pop('project_domain_name'))
# NOTE(starodubcevna): this is a workaround for the bug:
# https://bugs.launchpad.net/python-openstackclient/+bug/1447704