summaryrefslogtreecommitdiff
path: root/openstackclient/common/clientmanager.py
diff options
context:
space:
mode:
authorDean Troyer <dtroyer@gmail.com>2014-10-17 23:43:38 -0500
committerDean Troyer <dtroyer@gmail.com>2014-10-18 00:01:52 -0500
commit2166d7d3afbbdc1659e4cffdb7bcd890cd00ec19 (patch)
tree63f1596a4eab44fa41ac54d4692dd3ba7f4efa93 /openstackclient/common/clientmanager.py
parent0de67016c7daa1712b568cb2e49728fac3eb57ad (diff)
downloadpython-openstackclient-2166d7d3afbbdc1659e4cffdb7bcd890cd00ec19.tar.gz
Remove ClientManager._service_catalog
Anything that needs a service catalog can get it directly from auth_ref.service_catalog, no need to carry the extra attribute. ClientManager.get_endpoint_for_service_type() reamins the proper method to get an endpoint for clients that still need one directly. Change-Id: I809091c9c71d08f29606d7fd8b500898ff2cb8ae
Diffstat (limited to 'openstackclient/common/clientmanager.py')
-rw-r--r--openstackclient/common/clientmanager.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/openstackclient/common/clientmanager.py b/openstackclient/common/clientmanager.py
index 336c0da0..febcedf4 100644
--- a/openstackclient/common/clientmanager.py
+++ b/openstackclient/common/clientmanager.py
@@ -66,7 +66,6 @@ class ClientManager(object):
self._auth_params = auth.build_auth_params(auth_options)
self._region_name = auth_options.os_region_name
self._api_version = api_version
- self._service_catalog = None
self.timing = auth_options.timing
# For compatibility until all clients can be updated
@@ -104,7 +103,6 @@ class ClientManager(object):
if 'token' not in self._auth_params:
LOG.debug("Get service catalog")
self.auth_ref = self.auth.get_auth_ref(self.session)
- self._service_catalog = self.auth_ref.service_catalog
return
@@ -112,12 +110,14 @@ class ClientManager(object):
"""Return the endpoint URL for the service type."""
# See if we are using password flow auth, i.e. we have a
# service catalog to select endpoints from
- if self._service_catalog:
- endpoint = self._service_catalog.url_for(
- service_type=service_type, region_name=region_name)
+ if self.auth_ref:
+ endpoint = self.auth_ref.service_catalog.url_for(
+ service_type=service_type,
+ region_name=region_name,
+ )
else:
- # Hope we were given the correct URL.
- endpoint = self._auth_url or self._url
+ # Get the passed endpoint directly from the auth plugin
+ endpoint = self.auth.get_endpoint(self.session)
return endpoint