diff options
| author | Dean Troyer <dtroyer@gmail.com> | 2014-10-17 23:43:38 -0500 |
|---|---|---|
| committer | Dean Troyer <dtroyer@gmail.com> | 2014-10-18 00:01:52 -0500 |
| commit | 2166d7d3afbbdc1659e4cffdb7bcd890cd00ec19 (patch) | |
| tree | 63f1596a4eab44fa41ac54d4692dd3ba7f4efa93 /openstackclient/identity | |
| parent | 0de67016c7daa1712b568cb2e49728fac3eb57ad (diff) | |
| download | python-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/identity')
| -rw-r--r-- | openstackclient/identity/client.py | 24 | ||||
| -rw-r--r-- | openstackclient/identity/v2_0/service.py | 3 |
2 files changed, 6 insertions, 21 deletions
diff --git a/openstackclient/identity/client.py b/openstackclient/identity/client.py index bc10a6d2..8050d120 100644 --- a/openstackclient/identity/client.py +++ b/openstackclient/identity/client.py @@ -44,27 +44,11 @@ def make_client(instance): API_VERSIONS) LOG.debug('Instantiating identity client: %s', identity_client) - # TODO(dtroyer): Something doesn't like the session.auth when using - # token auth, chase that down. - if instance._url: - LOG.debug('Using service token auth') - client = identity_client( - endpoint=instance._url, - token=instance._auth_params['token'], - cacert=instance._cacert, - insecure=instance._insecure - ) - else: - LOG.debug('Using auth plugin: %s' % instance._auth_plugin) - client = identity_client( - session=instance.session, - cacert=instance._cacert, - ) + LOG.debug('Using auth plugin: %s' % instance._auth_plugin) + client = identity_client( + session=instance.session, + ) - # TODO(dtroyer): the identity v2 role commands use this yet, fix that - # so we can remove it - if not instance._url: - instance.auth_ref = instance.auth.get_auth_ref(instance.session) return client diff --git a/openstackclient/identity/v2_0/service.py b/openstackclient/identity/v2_0/service.py index 458dce7c..e8848dde 100644 --- a/openstackclient/identity/v2_0/service.py +++ b/openstackclient/identity/v2_0/service.py @@ -141,9 +141,10 @@ class ShowService(show.ShowOne): def take_action(self, parsed_args): self.log.debug('take_action(%s)', parsed_args) identity_client = self.app.client_manager.identity + auth_ref = self.app.client_manager.auth_ref if parsed_args.catalog: - endpoints = identity_client.service_catalog.get_endpoints( + endpoints = auth_ref.service_catalog.get_endpoints( service_type=parsed_args.service) for (service, service_endpoints) in six.iteritems(endpoints): if service_endpoints: |
