From 3188ea0f17da668afa1580def93ce9f17b690854 Mon Sep 17 00:00:00 2001 From: rabi Date: Tue, 14 Feb 2017 18:59:15 +0530 Subject: [PATCH] Use keystone v3 and session for swiftclient Allow for using keystone v3 and session with swiftclient in integration tests. This also cleans up some unnecessary arguments passed to clients. Change-Id: If68dc4840f99e852a5d2af53812661b3fc0aab55 --- heat_integrationtests/common/clients.py | 34 ++++++++----------------- 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/heat_integrationtests/common/clients.py b/heat_integrationtests/common/clients.py index 9949d3d96d..58e0fce3ec 100644 --- a/heat_integrationtests/common/clients.py +++ b/heat_integrationtests/common/clients.py @@ -149,51 +149,39 @@ class ClientManager(object): return KeystoneWrapperClient(auth, verify_cert) def _get_compute_client(self): - - region = self.conf.region # Create our default Nova client to use in testing return nova_client.Client( self.NOVA_API_VERSION, session=self.identity_client.session, service_type='compute', endpoint_type='publicURL', - region_name=region, + region_name=self.conf.region, os_cache=False, - insecure=self.insecure, - cacert=self.ca_file, http_log_debug=True) def _get_network_client(self): return neutron_client.Client( session=self.identity_client.session, - endpoint_type='publicURL', - insecure=self.insecure, - ca_cert=self.ca_file) + service_type='network', + region_name=self.conf.region, + endpoint_type='publicURL') def _get_volume_client(self): - region = self.conf.region - endpoint_type = 'publicURL' return cinder_client.Client( self.CINDERCLIENT_VERSION, session=self.identity_client.session, - region_name=region, - endpoint_type=endpoint_type, - insecure=self.insecure, - cacert=self.ca_file, + endpoint_type='publicURL', + region_name=self.conf.region, 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._tenant_name(), - 'user': self._username(), - 'key': self.conf.password, - 'authurl': self.conf.auth_url, - 'os_options': {'endpoint_type': 'publicURL'}, - 'insecure': self.insecure, - 'cacert': self.ca_file, + 'session': self.identity_client.session, + 'os_options': {'endpoint_type': 'publicURL', + 'region_name': self.conf.region, + 'service_type': 'object-store'}, } return swift_client.Connection(**args) @@ -206,8 +194,6 @@ class ClientManager(object): else: args = { 'session': self.identity_client.session, - 'insecure': self.insecure, - 'cacert': self.ca_file, 'region_name': self.conf.region, 'endpoint_type': 'publicURL', 'service_type': 'metering',