summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrabi <ramishra@redhat.com>2016-10-20 14:05:23 +0530
committerRabi Mishra <ramishra@redhat.com>2018-06-11 02:48:42 +0000
commitc000dd1d0940b47c13761bb09e0cb50a2adc6a2e (patch)
treed687e858f4b6741aaa3712cf067f3f82b9c12205
parentf095a0fd133a831ffeb04f9cb7f9d81a4f31a04a (diff)
downloadpython-heatclient-c000dd1d0940b47c13761bb09e0cb50a2adc6a2e.tar.gz
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
-rw-r--r--heatclient/osc/plugin.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/heatclient/osc/plugin.py b/heatclient/osc/plugin.py
index 8bc3f15..859a13e 100644
--- a/heatclient/osc/plugin.py
+++ b/heatclient/osc/plugin.py
@@ -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,