summaryrefslogtreecommitdiff
path: root/openstackclient/compute
diff options
context:
space:
mode:
authorDean Troyer <dtroyer@gmail.com>2012-05-04 12:28:35 -0500
committerDean Troyer <dtroyer@gmail.com>2012-05-04 16:37:18 -0500
commit70b3246a1983700736b7ce4c83e9381d987cc598 (patch)
treede32c02c765df7d7a765ef09d10a930ac5f79d9d /openstackclient/compute
parent5e4032150d360a305397e0220e51c5a66f2f5313 (diff)
downloadpython-openstackclient-70b3246a1983700736b7ce4c83e9381d987cc598.tar.gz
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
Diffstat (limited to 'openstackclient/compute')
-rw-r--r--openstackclient/compute/client.py9
1 files changed, 6 insertions, 3 deletions
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