summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrabi <ramishra@redhat.com>2017-02-18 13:02:20 +0530
committerRabi Mishra <ramishra@redhat.com>2019-03-15 09:13:17 +0000
commit97f2636dc72125897095e91b398da1cc20e9c39e (patch)
tree95fdd6dadda6914a9750060c06f4c74dab65a94b
parentfaacff2d7e0c1b6672c0c43107cb755e84e636ee (diff)
downloadheat-97f2636dc72125897095e91b398da1cc20e9c39e.tar.gz
Use keystone session with heatclient in integration tests
Change-Id: I4c66927e3dd3e1a91cfab94f26a24dbe8932bde8 Related-Bug: #1695144
-rw-r--r--heat_integrationtests/common/clients.py28
1 files changed, 12 insertions, 16 deletions
diff --git a/heat_integrationtests/common/clients.py b/heat_integrationtests/common/clients.py
index 7c8d1196b..d2cc92977 100644
--- a/heat_integrationtests/common/clients.py
+++ b/heat_integrationtests/common/clients.py
@@ -15,7 +15,6 @@ import os
from cinderclient import client as cinder_client
from heat.common.i18n import _
from heatclient import client as heat_client
-from keystoneauth1 import exceptions as kc_exceptions
from keystoneauth1.identity.generic import password
from keystoneauth1 import session
from neutronclient.v2_0 import client as neutron_client
@@ -104,22 +103,19 @@ class ClientManager(object):
def _get_orchestration_client(self):
endpoint = os.environ.get('HEAT_URL')
if os.environ.get('OS_NO_CLIENT_AUTH') == 'True':
- token = None
+ session = None
else:
- token = self.identity_client.auth_token
- try:
- if endpoint is None:
- endpoint = self.identity_client.get_endpoint_url(
- 'orchestration', self.conf.region)
- except kc_exceptions.EndpointNotFound:
- return None
- else:
- return heat_client.Client(
- self.HEATCLIENT_VERSION,
- endpoint,
- token=token,
- username=self._username(),
- password=self._password())
+ session = self.identity_client.session
+
+ return heat_client.Client(
+ self.HEATCLIENT_VERSION,
+ endpoint,
+ session=session,
+ endpoint_type='publicURL',
+ service_type='orchestration',
+ region_name=self.conf.region,
+ username=self._username(),
+ password=self._password())
def _get_identity_client(self):
user_domain_id = self.conf.user_domain_id