Remove deprecated [cinder]url

The `[cinder]endpoint_override` option should be used instead.

Change-Id: I90d68c57b9e152c57acfc634becfca7a84b5a8ac
This commit is contained in:
Iury Gregory Melo Ferreira 2020-05-14 16:55:51 +02:00
parent a5d120c8c3
commit 07fa299993
4 changed files with 4 additions and 30 deletions

View File

@ -49,16 +49,10 @@ def get_client(context):
service_auth = keystone.get_auth('cinder')
session = _get_cinder_session()
# TODO(pas-ha) remove in Rocky
adapter_opts = {}
# NOTE(pas-ha) new option must always win if set
if CONF.cinder.url and not CONF.cinder.endpoint_override:
adapter_opts['endpoint_override'] = CONF.cinder.url
# TODO(pas-ha) use versioned endpoint data to select required
# cinder api version
cinder_url = keystone.get_endpoint('cinder', session=session,
auth=service_auth, **adapter_opts)
auth=service_auth)
# TODO(pas-ha) investigate possibility of passing a user context here,
# similar to what neutron/glance-related code does
# NOTE(pas-ha) cinderclient has both 'connect_retries' (passed to

View File

@ -17,14 +17,6 @@ from ironic.common.i18n import _
from ironic.conf import auth
opts = [
cfg.URIOpt('url',
schemes=('http', 'https'),
deprecated_for_removal=True,
deprecated_reason=_('Use [cinder]/endpoint_override option '
'to set a specific cinder API URL to '
'connect to.'),
help=_('URL for connecting to cinder. If set, the value must '
'start with either http:// or https://.')),
cfg.IntOpt('retries',
default=3,
help=_('Client retries in the case of a failed request '

View File

@ -97,21 +97,6 @@ class TestCinderClient(base.TestCase):
auth=mock.sentinel.auth)
self.assertFalse(mock_sauth.called)
def test_get_client_deprecated_opts(self, mock_client_init, mock_session,
mock_auth, mock_sauth, mock_adapter):
self.config(url='http://test-url', group='cinder')
mock_adapter.return_value = mock_adapter_obj = mock.Mock()
mock_adapter_obj.get_endpoint.return_value = 'http://test-url'
self._assert_client_call(mock_client_init, 'http://test-url')
mock_auth.assert_called_once_with('cinder')
mock_session.assert_called_once_with('cinder')
mock_adapter.assert_called_once_with(
'cinder', session=mock.sentinel.session, auth=mock.sentinel.auth,
endpoint_override='http://test-url')
self.assertFalse(mock_sauth.called)
class TestCinderUtils(db_base.DbTestCase):

View File

@ -0,0 +1,3 @@
upgrade:
- |
The ``[cinder]url`` was removed, use ``[cinder]endpoint_override`` instead.