From 07fa299993f737dc85fb8d1b2d19189316c0afb3 Mon Sep 17 00:00:00 2001 From: Iury Gregory Melo Ferreira Date: Thu, 14 May 2020 16:55:51 +0200 Subject: [PATCH] Remove deprecated [cinder]url The `[cinder]endpoint_override` option should be used instead. Change-Id: I90d68c57b9e152c57acfc634becfca7a84b5a8ac --- ironic/common/cinder.py | 8 +------- ironic/conf/cinder.py | 8 -------- ironic/tests/unit/common/test_cinder.py | 15 --------------- .../notes/del-cinder-url-cf43cd0336c22878.yaml | 3 +++ 4 files changed, 4 insertions(+), 30 deletions(-) create mode 100644 releasenotes/notes/del-cinder-url-cf43cd0336c22878.yaml diff --git a/ironic/common/cinder.py b/ironic/common/cinder.py index c2afc021cc..cc140547ed 100644 --- a/ironic/common/cinder.py +++ b/ironic/common/cinder.py @@ -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 diff --git a/ironic/conf/cinder.py b/ironic/conf/cinder.py index a67cbd72a6..cbe55ea0ce 100644 --- a/ironic/conf/cinder.py +++ b/ironic/conf/cinder.py @@ -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 ' diff --git a/ironic/tests/unit/common/test_cinder.py b/ironic/tests/unit/common/test_cinder.py index 5768cf20bb..f3bd7ae771 100644 --- a/ironic/tests/unit/common/test_cinder.py +++ b/ironic/tests/unit/common/test_cinder.py @@ -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): diff --git a/releasenotes/notes/del-cinder-url-cf43cd0336c22878.yaml b/releasenotes/notes/del-cinder-url-cf43cd0336c22878.yaml new file mode 100644 index 0000000000..17732537e2 --- /dev/null +++ b/releasenotes/notes/del-cinder-url-cf43cd0336c22878.yaml @@ -0,0 +1,3 @@ +upgrade: + - | + The ``[cinder]url`` was removed, use ``[cinder]endpoint_override`` instead.