From 0de67016c7daa1712b568cb2e49728fac3eb57ad Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Fri, 17 Oct 2014 22:26:57 -0500 Subject: Remove now-unnecessary client creation hacks Clients that can use ksc Session don't need the old junk to fake auth anymore: * compute * volume Clients that still need to be fed credentials can pick directly from the auth object in clientmanager. The _token attribute is removed, the token can be retrieved from the auth object: openstackclient/tests/common/test_clientmanager.py This change will break any plugin that relies on getting a token from instance._token. They should be updated to use the above, or preferable, to use keystoneclient.session.Session to create its HTTP interface object. Change-Id: I877a29de97a42f85f12a14c274fc003e6fba5135 --- openstackclient/volume/client.py | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) (limited to 'openstackclient/volume') diff --git a/openstackclient/volume/client.py b/openstackclient/volume/client.py index 58cb267e..f4e2decb 100644 --- a/openstackclient/volume/client.py +++ b/openstackclient/volume/client.py @@ -49,29 +49,13 @@ def make_client(instance): http_log_debug = utils.get_effective_log_level() <= logging.DEBUG extensions = [extension.Extension('list_extensions', list_extensions)] + client = volume_client( - username=instance._username, - api_key=instance._password, - project_id=instance._project_name, - auth_url=instance._auth_url, - cacert=instance._cacert, - insecure=instance._insecure, - region_name=instance._region_name, + session=instance.session, extensions=extensions, http_log_debug=http_log_debug, ) - # Populate the Cinder client to skip another auth query to Identity - if instance._url: - # token flow - client.client.management_url = instance._url - else: - # password flow - client.client.management_url = instance.get_endpoint_for_service_type( - API_NAME, region_name=instance._region_name) - client.client.service_catalog = instance._service_catalog - client.client.auth_token = instance._token - return client -- cgit v1.2.1