Merge "Remove auth_uri usage"

This commit is contained in:
Zuul 2018-09-21 13:58:22 +00:00 committed by Gerrit Code Review
commit 95b287b842
10 changed files with 18 additions and 12 deletions

View File

@ -25,8 +25,8 @@ from cinder import exception
from cinder.i18n import _
CONF = cfg.CONF
CONF.import_opt('auth_uri', 'keystonemiddleware.auth_token.__init__',
'keystone_authtoken')
CONF.import_group('keystone_authtoken',
'keystonemiddleware.auth_token.__init__')
LOG = logging.getLogger(__name__)
@ -227,7 +227,7 @@ def _keystone_client(context, version=(3, 0)):
:return: keystoneclient.client.Client object
"""
auth_plugin = identity.Token(
auth_url=CONF.keystone_authtoken.auth_uri,
auth_url=CONF.keystone_authtoken.auth_url,
token=context.auth_token,
project_id=context.project_id)
@ -237,7 +237,7 @@ def _keystone_client(context, version=(3, 0)):
cacert=CONF.keystone_authtoken.cafile,
key=CONF.keystone_authtoken.keyfile,
cert=CONF.keystone_authtoken.certfile)
return client.Client(auth_url=CONF.keystone_authtoken.auth_uri,
return client.Client(auth_url=CONF.keystone_authtoken.auth_url,
session=client_session, version=version)

View File

@ -28,6 +28,7 @@ import uuid
from eventlet import tpool
import fixtures
from keystonemiddleware import auth_token
import mock
from oslo_concurrency import lockutils
from oslo_config import fixture as config_fixture
@ -215,6 +216,11 @@ class TestCase(testtools.TestCase):
rpc.LAST_OBJ_VERSIONS = {}
rpc.LAST_RPC_VERSIONS = {}
# Init AuthProtocol to register some base options first, such as
# auth_url.
auth_token.AuthProtocol('fake_app', {'auth_type': 'password',
'auth_url': 'fake_url'})
conf_fixture.set_defaults(CONF)
CONF([], default_config_files=[])

View File

@ -117,7 +117,7 @@ class QuotaSetsControllerTestBase(test.TestCase):
self.auth_url = 'http://localhost:5000'
self.fixture = self.useFixture(config_fixture.Config(CONF))
self.fixture.config(auth_uri=self.auth_url, group='keystone_authtoken')
self.fixture.config(auth_url=self.auth_url, group='keystone_authtoken')
def _create_project_hierarchy(self):
r"""Sets an environment used for nested quotas tests.

View File

@ -56,4 +56,4 @@ def set_defaults(conf):
conf.set_default('policy_dirs', [], group='oslo_policy')
# This is where we don't authenticate
conf.set_default('auth_strategy', 'noauth')
conf.set_default('auth_uri', 'fake', 'keystone_authtoken')
conf.set_default('auth_url', 'fake', 'keystone_authtoken')

View File

@ -1451,7 +1451,7 @@ class NestedDbQuotaDriverBaseTestCase(DbQuotaDriverBaseTestCase):
self.addCleanup(keystone_patcher.stop)
self.fixture = self.useFixture(config_fixture.Config(CONF))
self.fixture.config(auth_uri=self.auth_url, group='keystone_authtoken')
self.fixture.config(auth_url=self.auth_url, group='keystone_authtoken')
self.driver = quota.NestedDbQuotaDriver()
def _mock_get_by_subproject(self):

View File

@ -43,7 +43,7 @@ class QuotaUtilsTest(test.TestCase):
self.auth_url = 'http://localhost:5000'
self.context = context.RequestContext('fake_user', 'fake_proj_id')
self.fixture = self.useFixture(config_fixture.Config(CONF))
self.fixture.config(auth_uri=self.auth_url, group='keystone_authtoken')
self.fixture.config(auth_url=self.auth_url, group='keystone_authtoken')
@mock.patch('keystoneclient.client.Client')
@mock.patch('keystoneauth1.session.Session')

View File

@ -277,7 +277,7 @@ Install and configure components
[keystone_authtoken]
# ...
auth_uri = http://controller:5000
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000
memcached_servers = controller:11211
auth_type = password

View File

@ -276,7 +276,7 @@ Install and configure components
[keystone_authtoken]
# ...
auth_uri = http://controller:5000
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000
memcached_servers = controller:11211
auth_type = password

View File

@ -158,7 +158,7 @@ Install and configure components
[keystone_authtoken]
# ...
auth_uri = http://controller:5000
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000
memcached_servers = controller:11211
auth_type = password

View File

@ -156,7 +156,7 @@ Install and configure components
[keystone_authtoken]
# ...
auth_uri = http://controller:5000
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000
memcached_servers = controller:11211
auth_type = password