Handle token_endpoint auth type in osc plugin

There can be situations where the auth_type=token_endpoint, we
should use the appropriate attributes from the auth plugin when
creating heatclient.

Change-Id: Ic929f6ceaa92002eb2b3443934d1f541758e4dda
Closes-Bug: #1632341
This commit is contained in:
rabi 2016-10-20 14:05:23 +05:30 committed by Rabi Mishra
parent f095a0fd13
commit c000dd1d09
1 changed files with 3 additions and 1 deletions

View File

@ -41,13 +41,15 @@ def make_client(instance):
if instance.session:
kwargs.update({'session': instance.session,
'service_type': API_NAME})
elif instance.auth_plugin_name == 'token_endpoint':
kwargs.update({'endpoint': instance.auth.url,
'token': instance.auth.token})
else:
endpoint = instance.get_endpoint_for_service_type(
API_NAME,
region_name=instance.region_name,
interface=instance.interface,
)
kwargs.update({'endpoint': endpoint,
'auth_url': instance.auth.auth_url,
'username': instance.auth_ref.username,