Pass only tenant name or ID to keystoneclient
When creating the keystoneclient, we only need to pass the tenant ID or name, not both Change-Id: I0dd03759979026daba1be343f7194f9b7e15a589
This commit is contained in:
parent
845018fbf3
commit
be6852bf32
|
@ -220,12 +220,15 @@ class HeatShell(object):
|
|||
:param tenant_name: name of tenant
|
||||
:param auth_url: endpoint to authenticate against
|
||||
"""
|
||||
return ksclient.Client(username=kwargs.get('username'),
|
||||
password=kwargs.get('password'),
|
||||
tenant_id=kwargs.get('tenant_id'),
|
||||
tenant_name=kwargs.get('tenant_name'),
|
||||
auth_url=kwargs.get('auth_url'),
|
||||
insecure=kwargs.get('insecure'))
|
||||
kc_args = {'auth_url': kwargs.get('auth_url'),
|
||||
'insecure': kwargs.get('insecure'),
|
||||
'username': kwargs.get('username'),
|
||||
'password': kwargs.get('password')}
|
||||
if kwargs.get('tenant_id'):
|
||||
kc_args['tenant_id'] = kwargs.get('tenant_id')
|
||||
else:
|
||||
kc_args['tenant_name'] = kwargs.get('tenant_name')
|
||||
return ksclient.Client(**kc_args)
|
||||
|
||||
def _get_endpoint(self, client, **kwargs):
|
||||
"""Get an endpoint using the provided keystone client."""
|
||||
|
|
|
@ -22,7 +22,6 @@ def script_keystone_client():
|
|||
ksclient.Client(auth_url='http://no.where',
|
||||
insecure=False,
|
||||
password='password',
|
||||
tenant_id='',
|
||||
tenant_name='tenant_name',
|
||||
username='username').AndReturn(FakeKeystone('abcd1234'))
|
||||
|
||||
|
|
Loading…
Reference in New Issue