From 70b3246a1983700736b7ce4c83e9381d987cc598 Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Fri, 4 May 2012 12:28:35 -0500 Subject: Add Identity to ClientManager * Make the Identity client in identity.client.make_client() * Auth via ClientManager.identity * Skip extra auth roundtrip in compute client Change-Id: I0190639e38f83997c233195f6cc27ff3afdfba10 --- openstackclient/compute/client.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'openstackclient/compute/client.py') diff --git a/openstackclient/compute/client.py b/openstackclient/compute/client.py index ef0ceb38..07f69aa1 100644 --- a/openstackclient/compute/client.py +++ b/openstackclient/compute/client.py @@ -9,8 +9,6 @@ def make_client(instance): """Returns a compute service client. """ LOG.debug('instantiating compute client') - # FIXME(dhellmann): Where is the endpoint value used? - # url = instance.get_endpoint_for_service_type('compute') client = nova_client.Client( version=instance._compute_api_version, username=instance._username, @@ -28,5 +26,10 @@ def make_client(instance): # FIXME(dhellmann): what is service_name? service_name='', ) - client.authenticate() + + # Populate the Nova client to skip another auth query to Identity + client.client.management_url = instance.get_endpoint_for_service_type( + 'compute') + client.client.service_catalog = instance._service_catalog + client.client.auth_token = instance._token return client -- cgit v1.2.1