Merge "Use region_name and interface with session"
This commit is contained in:
@@ -33,24 +33,23 @@ def make_client(instance):
|
|||||||
API_VERSIONS)
|
API_VERSIONS)
|
||||||
LOG.debug('Instantiating orchestration client: %s', heat_client)
|
LOG.debug('Instantiating orchestration client: %s', heat_client)
|
||||||
|
|
||||||
|
kwargs = {'region_name': instance.region_name,
|
||||||
|
'interface': instance.interface}
|
||||||
|
|
||||||
if instance.session:
|
if instance.session:
|
||||||
kwargs = {'session': instance.session,
|
kwargs.update({'session': instance.session,
|
||||||
'service_type': API_NAME}
|
'service_type': API_NAME})
|
||||||
else:
|
else:
|
||||||
# Note: We can change '_interface' and '_region_name' once
|
|
||||||
# the requirements change to python-openstackclient-2.6.1
|
|
||||||
endpoint = instance.get_endpoint_for_service_type(
|
endpoint = instance.get_endpoint_for_service_type(
|
||||||
API_NAME,
|
API_NAME,
|
||||||
region_name=instance._region_name,
|
region_name=instance.region_name,
|
||||||
interface=instance._interface,
|
interface=instance.interface,
|
||||||
)
|
)
|
||||||
|
|
||||||
kwargs = {'endpoint': endpoint,
|
kwargs.update({'endpoint': endpoint,
|
||||||
'auth_url': instance.auth.auth_url,
|
'auth_url': instance.auth.auth_url,
|
||||||
'region_name': instance._region_name,
|
'username': instance.auth_ref.username,
|
||||||
'username': instance.auth_ref.username}
|
'token': instance.auth_ref.auth_token})
|
||||||
|
|
||||||
kwargs.update(token=instance.auth_ref.auth_token)
|
|
||||||
|
|
||||||
client = heat_client(**kwargs)
|
client = heat_client(**kwargs)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user