Remove [conductor]api_url

It was deprecated long before.

Change-Id: I05d8a90dbf6e92ef230b1a9624c6816fc96c6a7f
This commit is contained in:
Kaifeng Wang 2020-05-01 14:10:34 +08:00
parent 1bb5e80ae4
commit 3e6dfdb3b9
7 changed files with 8 additions and 36 deletions

View File

@ -30,17 +30,6 @@ opts = [
cfg.IntOpt('heartbeat_interval',
default=10,
help=_('Seconds between conductor heart beats.')),
cfg.URIOpt('api_url',
schemes=('http', 'https'),
deprecated_for_removal=True,
deprecated_reason=_("Use [service_catalog]endpoint_override "
"option instead if required to use "
"a specific ironic api address, "
"for example in noauth mode."),
help=_('URL of Ironic API service. If not set ironic can '
'get the current value from the keystone service '
'catalog. If set, the value must start with either '
'http:// or https://.')),
cfg.IntOpt('heartbeat_timeout',
default=60,
# We're using timedelta which can overflow if somebody sets this

View File

@ -92,10 +92,6 @@ def get_ironic_api_url():
CONF.set_override('auth_type', 'none', group='service_catalog')
adapter_opts['auth'] = keystone.get_auth('service_catalog')
# TODO(pas-ha) remove in Rocky
# NOTE(pas-ha) if both set, the new options win
if CONF.conductor.api_url and not CONF.service_catalog.endpoint_override:
adapter_opts['endpoint_override'] = CONF.conductor.api_url
try:
ironic_api = keystone.get_endpoint('service_catalog', **adapter_opts)
except (exception.KeystoneFailure,

View File

@ -1155,8 +1155,6 @@ class PXEBuildConfigOptionsTestCase(db_base.DbTestCase):
ramdisk_params=None):
self.config(debug=debug)
self.config(pxe_append_params='test_param', group='pxe')
# NOTE: right '/' should be removed from url string
self.config(api_url='http://192.168.122.184:6385', group='conductor')
driver_internal_info = self.node.driver_internal_info
driver_internal_info['is_whole_disk_image'] = whle_dsk_img
@ -1415,8 +1413,6 @@ class iPXEBuildConfigOptionsTestCase(db_base.DbTestCase):
mode='deploy'):
self.config(debug=debug)
self.config(pxe_append_params='test_param', group='pxe')
# NOTE: right '/' should be removed from url string
self.config(api_url='http://192.168.122.184:6385', group='conductor')
self.config(ipxe_timeout=ipxe_timeout, group='pxe')
root_dir = CONF.deploy.http_root

View File

@ -771,16 +771,6 @@ class OtherFunctionTestCase(db_base.DbTestCase):
mock_clean_up_caches.assert_called_once_with(None, 'master_dir',
[('uuid', 'path')])
@mock.patch('ironic.common.keystone.get_auth')
@mock.patch.object(utils, '_get_ironic_session')
def test_get_ironic_api_url_from_config(self, mock_ks, mock_auth):
mock_sess = mock.Mock()
mock_ks.return_value = mock_sess
fake_api_url = 'http://foo/'
self.config(api_url=fake_api_url, group='conductor')
# also checking for stripped trailing slash
self.assertEqual(fake_api_url[:-1], utils.get_ironic_api_url())
@mock.patch('ironic.common.keystone.get_auth')
@mock.patch.object(utils, '_get_ironic_session')
@mock.patch('ironic.common.keystone.get_adapter')
@ -791,7 +781,6 @@ class OtherFunctionTestCase(db_base.DbTestCase):
fake_api_url = 'http://foo/'
mock_ka.return_value.get_endpoint.return_value = fake_api_url
# NOTE(pas-ha) endpoint_override is None by default
self.config(api_url=None, group='conductor')
url = utils.get_ironic_api_url()
# also checking for stripped trailing slash
self.assertEqual(fake_api_url[:-1], url)
@ -807,7 +796,6 @@ class OtherFunctionTestCase(db_base.DbTestCase):
mock_ks.return_value = mock_sess
mock_ka.return_value.get_endpoint.side_effect = (
exception.KeystoneFailure())
self.config(api_url=None, group='conductor')
self.assertRaises(exception.InvalidParameterValue,
utils.get_ironic_api_url)
@ -818,7 +806,6 @@ class OtherFunctionTestCase(db_base.DbTestCase):
mock_sess = mock.Mock()
mock_ks.return_value = mock_sess
mock_ka.return_value.get_endpoint.return_value = None
self.config(api_url=None, group='conductor')
self.assertRaises(exception.InvalidParameterValue,
utils.get_ironic_api_url)
@ -1192,13 +1179,13 @@ class AgentMethodsTestCase(db_base.DbTestCase):
self._test_tear_down_inband_cleaning(cleaning_error=True)
def test_build_agent_options_conf(self):
self.config(api_url='https://api-url', group='conductor')
self.config(endpoint_override='https://api-url',
group='service_catalog')
options = utils.build_agent_options(self.node)
self.assertEqual('https://api-url', options['ipa-api-url'])
@mock.patch.object(utils, '_get_ironic_session')
def test_build_agent_options_keystone(self, session_mock):
self.config(api_url=None, group='conductor')
sess = mock.Mock()
sess.get_endpoint.return_value = 'https://api-url'
session_mock.return_value = sess

View File

@ -83,7 +83,6 @@ class iPXEBootTestCase(db_base.DbTestCase):
driver_internal_info=self.driver_internal_info)
self.port = obj_utils.create_test_port(self.context,
node_id=self.node.id)
self.config(group='conductor', api_url='http://127.0.0.1:1234/')
def test_get_properties(self):
expected = pxe_base.COMMON_PROPERTIES

View File

@ -85,7 +85,6 @@ class PXEBootTestCase(db_base.DbTestCase):
driver_internal_info=self.driver_internal_info)
self.port = obj_utils.create_test_port(self.context,
node_id=self.node.id)
self.config(group='conductor', api_url='http://127.0.0.1:1234/')
self.config(my_ipv6='2001:db8::1')
def test_get_properties(self):

View File

@ -0,0 +1,6 @@
---
upgrade:
- |
The ``[conductor]api_url`` was deprecated and removed, use
``[service_catalog]endpoint_override`` instead if required to use
a specific ironic api url.