summaryrefslogtreecommitdiff
path: root/heat_integrationtests
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-07-06 04:03:35 +0000
committerGerrit Code Review <review@openstack.org>2016-07-06 04:03:35 +0000
commit5dc4d26b7f19d28afe59dbcfe5fd96051c625794 (patch)
tree09c73c9e1d9ecd0df91530a3e7e1588fbf22f0a6 /heat_integrationtests
parent6ad798ef71640ac79661a00c0b72af2197e6b5d9 (diff)
parent59713c52650605287d6878b6d3ca749ff7dbaa45 (diff)
downloadheat-5dc4d26b7f19d28afe59dbcfe5fd96051c625794.tar.gz
Merge "Pass keystone session to clients"
Diffstat (limited to 'heat_integrationtests')
-rw-r--r--heat_integrationtests/common/clients.py41
1 files changed, 6 insertions, 35 deletions
diff --git a/heat_integrationtests/common/clients.py b/heat_integrationtests/common/clients.py
index e7a3f311b..9f58678ca 100644
--- a/heat_integrationtests/common/clients.py
+++ b/heat_integrationtests/common/clients.py
@@ -70,14 +70,13 @@ class ClientManager(object):
def __init__(self, conf):
self.conf = conf
if self.conf.auth_url.find('/v'):
- self.v2_auth_url = self.conf.auth_url.replace('/v3', '/v2.0')
self.auth_version = self.conf.auth_url.split('/v')[1]
else:
raise ValueError(_('Incorrectly specified auth_url config: no '
'version found.'))
-
self.insecure = self.conf.disable_ssl_certificate_validation
self.ca_file = self.conf.ca_file
+
self.identity_client = self._get_identity_client()
self.orchestration_client = self._get_orchestration_client()
self.compute_client = self._get_compute_client()
@@ -131,19 +130,10 @@ class ClientManager(object):
def _get_compute_client(self):
region = self.conf.region
-
- client_args = (
- self.conf.username,
- self.conf.password,
- self.conf.tenant_name,
- # novaclient can not use v3 url
- self.v2_auth_url
- )
-
# Create our default Nova client to use in testing
return nova_client.Client(
self.NOVA_API_VERSION,
- *client_args,
+ session=self.identity_client.session,
service_type='compute',
endpoint_type='publicURL',
region_name=region,
@@ -155,12 +145,8 @@ class ClientManager(object):
def _get_network_client(self):
return neutron_client.Client(
- username=self.conf.username,
- password=self.conf.password,
- tenant_name=self.conf.tenant_name,
+ session=self.identity_client.session,
endpoint_type='publicURL',
- # neutronclient can not use v3 url
- auth_url=self.v2_auth_url,
insecure=self.insecure,
ca_cert=self.ca_file)
@@ -169,11 +155,7 @@ class ClientManager(object):
endpoint_type = 'publicURL'
return cinder_client.Client(
self.CINDERCLIENT_VERSION,
- self.conf.username,
- self.conf.password,
- self.conf.tenant_name,
- # cinderclient can not use v3 url
- self.v2_auth_url,
+ session=self.identity_client.session,
region_name=region,
endpoint_type=endpoint_type,
insecure=self.insecure,
@@ -181,6 +163,7 @@ class ClientManager(object):
http_log_debug=True)
def _get_object_client(self):
+ # swiftclient does not support keystone sessions yet
args = {
'auth_version': self.auth_version,
'tenant_name': self.conf.tenant_name,
@@ -194,8 +177,6 @@ class ClientManager(object):
return swift_client.Connection(**args)
def _get_metering_client(self):
- user_domain_name = self.conf.user_domain_name
- project_domain_name = self.conf.project_domain_name
try:
endpoint = self.identity_client.get_endpoint_url('metering',
self.conf.region)
@@ -203,22 +184,12 @@ class ClientManager(object):
return None
else:
args = {
- 'username': self.conf.username,
- 'password': self.conf.password,
- 'tenant_name': self.conf.tenant_name,
- 'auth_url': self.conf.auth_url,
+ 'session': self.identity_client.session,
'insecure': self.insecure,
'cacert': self.ca_file,
'region_name': self.conf.region,
'endpoint_type': 'publicURL',
'service_type': 'metering',
}
- # ceilometerclient can't ignore domain details for
- # v2 auth_url
- if self.auth_version == '3':
- args.update(
- {'user_domain_name': user_domain_name,
- 'project_domain_name': project_domain_name})
-
return ceilometer_client.Client(self.CEILOMETER_VERSION,
endpoint, **args)