Remove deprecated [cinder]url
The `[cinder]endpoint_override` option should be used instead. Change-Id: I90d68c57b9e152c57acfc634becfca7a84b5a8ac
This commit is contained in:
parent
a5d120c8c3
commit
07fa299993
@ -49,16 +49,10 @@ def get_client(context):
|
|||||||
service_auth = keystone.get_auth('cinder')
|
service_auth = keystone.get_auth('cinder')
|
||||||
session = _get_cinder_session()
|
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
|
# TODO(pas-ha) use versioned endpoint data to select required
|
||||||
# cinder api version
|
# cinder api version
|
||||||
cinder_url = keystone.get_endpoint('cinder', session=session,
|
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,
|
# TODO(pas-ha) investigate possibility of passing a user context here,
|
||||||
# similar to what neutron/glance-related code does
|
# similar to what neutron/glance-related code does
|
||||||
# NOTE(pas-ha) cinderclient has both 'connect_retries' (passed to
|
# NOTE(pas-ha) cinderclient has both 'connect_retries' (passed to
|
||||||
|
@ -17,14 +17,6 @@ from ironic.common.i18n import _
|
|||||||
from ironic.conf import auth
|
from ironic.conf import auth
|
||||||
|
|
||||||
opts = [
|
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',
|
cfg.IntOpt('retries',
|
||||||
default=3,
|
default=3,
|
||||||
help=_('Client retries in the case of a failed request '
|
help=_('Client retries in the case of a failed request '
|
||||||
|
@ -97,21 +97,6 @@ class TestCinderClient(base.TestCase):
|
|||||||
auth=mock.sentinel.auth)
|
auth=mock.sentinel.auth)
|
||||||
self.assertFalse(mock_sauth.called)
|
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):
|
class TestCinderUtils(db_base.DbTestCase):
|
||||||
|
|
||||||
|
3
releasenotes/notes/del-cinder-url-cf43cd0336c22878.yaml
Normal file
3
releasenotes/notes/del-cinder-url-cf43cd0336c22878.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
upgrade:
|
||||||
|
- |
|
||||||
|
The ``[cinder]url`` was removed, use ``[cinder]endpoint_override`` instead.
|
Loading…
Reference in New Issue
Block a user