Revert "Use interface not endpoint_type for keystoneclient"

This reverts commit 38e5eba621.

This patch introduced a bug when using Keystone v2. With this patch, the
following works:

python -c "import os_client_config; print(os_client_config.make_client('identity', auth_url='http://localhost/identity_admin', username='admin', project_name='admin', password='testtest', identity_api_version='3').roles.list())"

But changing identity_api_version from 3 to 2.0 raises an exception.

Without this patch, both 3 and 2.0 works.

Change-Id: I8d2ad71ff51a08af1166d36805b740ea272939ed
This commit is contained in:
Jordan Pittier 2017-05-03 13:11:10 +00:00
parent 17debbb099
commit 4493871824
2 changed files with 3 additions and 3 deletions

View File

@ -367,7 +367,7 @@ class CloudConfig(object):
endpoint_override = self.get_endpoint(service_key)
if not interface_key:
if service_key in ('image', 'key-manager', 'identity'):
if service_key in ('image', 'key-manager'):
interface_key = 'interface'
else:
interface_key = 'endpoint_type'

View File

@ -550,7 +550,7 @@ class TestCloudConfig(base.TestCase):
mock_client.assert_called_with(
version='2.0',
endpoint='http://example.com/v2',
interface='admin',
endpoint_type='admin',
endpoint_override=None,
region_name='region-al',
service_type='identity',
@ -570,7 +570,7 @@ class TestCloudConfig(base.TestCase):
mock_client.assert_called_with(
version='3',
endpoint='http://example.com',
interface='admin',
endpoint_type='admin',
endpoint_override=None,
region_name='region-al',
service_type='identity',