From 4493871824839782846c3825c754895876f8d08e Mon Sep 17 00:00:00 2001 From: Jordan Pittier Date: Wed, 3 May 2017 13:11:10 +0000 Subject: [PATCH] Revert "Use interface not endpoint_type for keystoneclient" This reverts commit 38e5eba621e48d74c05315da2b89e6c801f4c43f. 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 --- os_client_config/cloud_config.py | 2 +- os_client_config/tests/test_cloud_config.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/os_client_config/cloud_config.py b/os_client_config/cloud_config.py index fec3500..776ea8a 100644 --- a/os_client_config/cloud_config.py +++ b/os_client_config/cloud_config.py @@ -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' diff --git a/os_client_config/tests/test_cloud_config.py b/os_client_config/tests/test_cloud_config.py index 5df1faf..3ec7ecf 100644 --- a/os_client_config/tests/test_cloud_config.py +++ b/os_client_config/tests/test_cloud_config.py @@ -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',