Remove two DEPRECATED config options from [agent]
Remove two config options that were DEPRECATED in Liberty cycle from the config group section [agent]. They are: - agent_pxe_append_params - agent_pxe_config_template These were marked for removal in the Mitaka release. Change-Id: I5ceb895db7dcd7150b93059ddc8c4084228efca0 Closes-Bug: 1570475
This commit is contained in:
parent
47f40c7c60
commit
e9bf491686
@ -1293,13 +1293,6 @@ The web console can be configured in Bare Metal service in the following way:
|
||||
#Additional append parameters for bare metal PXE boot. (string value)
|
||||
pxe_append_params = nofb nomodeset vga=normal console=tty0 console=ttyS0,115200n8
|
||||
|
||||
agent_* driver:
|
||||
|
||||
[agent]
|
||||
|
||||
#Additional append parameters for bare metal PXE boot. (string value)
|
||||
agent_pxe_append_params = nofb nomodeset vga=normal console=tty0 console=ttyS0,115200n8
|
||||
|
||||
* Configure node web console.
|
||||
|
||||
Enable the web console, for example::
|
||||
|
@ -405,17 +405,6 @@
|
||||
# Options defined in ironic.drivers.modules.agent
|
||||
#
|
||||
|
||||
# DEPRECATED. Additional append parameters for baremetal PXE
|
||||
# boot. This option is deprecated and will be removed in
|
||||
# Mitaka release. Please use [pxe]pxe_append_params instead.
|
||||
# (string value)
|
||||
#agent_pxe_append_params = nofb nomodeset vga=normal
|
||||
|
||||
# DEPRECATED. Template file for PXE configuration. This option
|
||||
# is deprecated and will be removed in Mitaka release. Please
|
||||
# use [pxe]pxe_config_template instead. (string value)
|
||||
#agent_pxe_config_template = $pybasedir/drivers/modules/agent_config.template
|
||||
|
||||
# Whether Ironic will manage booting of the agent ramdisk. If
|
||||
# set to False, you will need to configure your mechanism to
|
||||
# allow booting the agent ramdisk. (boolean value)
|
||||
@ -1340,8 +1329,9 @@
|
||||
|
||||
# The port number on which the iSCSI portal listens for
|
||||
# incoming connections. (port value)
|
||||
# Possible values: 0-65535
|
||||
#portal_port=3260
|
||||
# Minimum value: 0
|
||||
# Maximum value: 65535
|
||||
#portal_port = 3260
|
||||
|
||||
|
||||
[keystone]
|
||||
|
@ -27,7 +27,6 @@ from ironic.common.i18n import _LI
|
||||
from ironic.common.i18n import _LW
|
||||
from ironic.common import image_service
|
||||
from ironic.common import images
|
||||
from ironic.common import paths
|
||||
from ironic.common import raid
|
||||
from ironic.common import states
|
||||
from ironic.common import utils
|
||||
@ -39,19 +38,6 @@ from ironic.drivers.modules import deploy_utils
|
||||
|
||||
|
||||
agent_opts = [
|
||||
cfg.StrOpt('agent_pxe_append_params',
|
||||
default='nofb nomodeset vga=normal',
|
||||
help=_('DEPRECATED. Additional append parameters for '
|
||||
'baremetal PXE boot. This option is deprecated and '
|
||||
'will be removed in Mitaka release. Please use '
|
||||
'[pxe]pxe_append_params instead.')),
|
||||
cfg.StrOpt('agent_pxe_config_template',
|
||||
default=paths.basedir_def(
|
||||
'drivers/modules/agent_config.template'),
|
||||
help=_('DEPRECATED. Template file for PXE configuration. '
|
||||
'This option is deprecated and will be removed '
|
||||
'in Mitaka release. Please use [pxe]pxe_config_template '
|
||||
'instead.')),
|
||||
cfg.BoolOpt('manage_agent_boot',
|
||||
default=True,
|
||||
deprecated_name='manage_tftp',
|
||||
|
@ -35,7 +35,6 @@ from ironic.common import paths
|
||||
from ironic.common import pxe_utils
|
||||
from ironic.common import states
|
||||
from ironic.drivers import base
|
||||
from ironic.drivers.modules import agent
|
||||
from ironic.drivers.modules import deploy_utils
|
||||
from ironic.drivers.modules import image_cache
|
||||
from ironic.drivers import utils as driver_utils
|
||||
@ -108,50 +107,6 @@ REQUIRED_PROPERTIES = {
|
||||
COMMON_PROPERTIES = REQUIRED_PROPERTIES
|
||||
|
||||
|
||||
# TODO(rameshg87): This method is only for allowing time for deployers to
|
||||
# migrate to CONF.pxe.<options> after the CONF.agent.<pxe-options> have been
|
||||
# deprecated. Remove this in Mitaka release.
|
||||
def _get_pxe_conf_option(task, opt_name):
|
||||
"""Returns the value of PXEBoot provided CONF option.
|
||||
|
||||
This method returns the value of PXEBoot CONF option after checking
|
||||
the driver.deploy. If driver.deploy is AgentDeploy and the value of
|
||||
the CONF option is not it's default value, it returns the value of
|
||||
CONF.agent.agent_<opt_name>. Otherwise, it returns the value of
|
||||
CONF.pxe.<opt_name>. There are only 2 such parameters right now -
|
||||
pxe_config_template and pxe_append_params. Caller
|
||||
has to make sure that only these 2 options are passed.
|
||||
|
||||
:param task: TaskManager instance.
|
||||
:param opt_name: The CONF opt whose value is desired.
|
||||
:returns: The value of the CONF option.
|
||||
:raises: AttributeError, if such a CONF option doesn't exist.
|
||||
"""
|
||||
if isinstance(task.driver.deploy, agent.AgentDeploy):
|
||||
agent_opt_name = 'agent_' + opt_name
|
||||
current_value = getattr(CONF.agent, agent_opt_name)
|
||||
opt_object = [x for x in agent.agent_opts
|
||||
if x.name == agent_opt_name][0]
|
||||
default_value = opt_object.default
|
||||
# Replace $pybasedir which can occur in pxe_config_template
|
||||
# default value.
|
||||
default_value = default_value.replace('$pybasedir',
|
||||
CONF.pybasedir)
|
||||
|
||||
if current_value != default_value:
|
||||
LOG.warning(
|
||||
_LW("The CONF option [agent]agent_%(opt_name)s is "
|
||||
"deprecated and will be removed in Mitaka release of "
|
||||
"Ironic. Please use [pxe]%(opt_name)s instead."),
|
||||
{'opt_name': opt_name})
|
||||
return current_value
|
||||
|
||||
# Either task.driver.deploy is ISCSIDeploy() or the default value hasn't
|
||||
# been modified. So return the value of corresponding parameter in
|
||||
# [pxe] group.
|
||||
return getattr(CONF.pxe, opt_name)
|
||||
|
||||
|
||||
def _parse_driver_info(node):
|
||||
"""Gets the driver specific Node deployment info.
|
||||
|
||||
@ -275,7 +230,7 @@ def _build_pxe_config_options(task, pxe_info):
|
||||
pxe_options = {
|
||||
'deployment_aki_path': deploy_kernel,
|
||||
'deployment_ari_path': deploy_ramdisk,
|
||||
'pxe_append_params': _get_pxe_conf_option(task, 'pxe_append_params'),
|
||||
'pxe_append_params': CONF.pxe.pxe_append_params,
|
||||
'tftp_server': CONF.pxe.tftp_server,
|
||||
'aki_path': kernel,
|
||||
'ari_path': ramdisk,
|
||||
@ -476,8 +431,7 @@ class PXEBoot(base.BootInterface):
|
||||
if deploy_utils.get_boot_mode_for_deploy(node) == 'uefi':
|
||||
pxe_config_template = CONF.pxe.uefi_pxe_config_template
|
||||
else:
|
||||
pxe_config_template = _get_pxe_conf_option(task,
|
||||
'pxe_config_template')
|
||||
pxe_config_template = CONF.pxe.pxe_config_template
|
||||
|
||||
pxe_utils.create_pxe_config(task, pxe_options,
|
||||
pxe_config_template)
|
||||
|
@ -113,17 +113,6 @@ class TestPXEUtils(db_base.DbTestCase):
|
||||
|
||||
self.assertEqual(six.text_type(expected_template), rendered_template)
|
||||
|
||||
def test__build_pxe_config_with_agent(self):
|
||||
|
||||
rendered_template = pxe_utils._build_pxe_config(
|
||||
self.agent_pxe_options, CONF.agent.agent_pxe_config_template,
|
||||
'{{ ROOT }}', '{{ DISK_IDENTIFIER }}')
|
||||
|
||||
template_file = 'ironic/tests/unit/drivers/agent_pxe_config.template'
|
||||
expected_template = open(template_file).read().rstrip()
|
||||
|
||||
self.assertEqual(six.text_type(expected_template), rendered_template)
|
||||
|
||||
def test__build_ipxe_bios_config(self):
|
||||
# NOTE(lucasagomes): iPXE is just an extension of the PXE driver,
|
||||
# it doesn't have it's own configuration option for template.
|
||||
|
@ -60,34 +60,6 @@ class PXEPrivateMethodsTestCase(db_base.DbTestCase):
|
||||
mgr_utils.mock_the_extension_manager(driver="fake_pxe")
|
||||
self.node = obj_utils.create_test_node(self.context, **n)
|
||||
|
||||
def _test_get_pxe_conf_option(self, driver, expected_value):
|
||||
mgr_utils.mock_the_extension_manager(driver=driver)
|
||||
self.node.driver = driver
|
||||
self.node.save()
|
||||
|
||||
with task_manager.acquire(self.context, self.node.uuid) as task:
|
||||
returned_value = pxe._get_pxe_conf_option(
|
||||
task, 'pxe_config_template')
|
||||
|
||||
self.assertEqual(expected_value, returned_value)
|
||||
|
||||
def test_get_pxe_conf_option_iscsi_deploy(self):
|
||||
self.config(group='pxe', pxe_config_template='my-pxe-config-template')
|
||||
self._test_get_pxe_conf_option('fake_pxe',
|
||||
'my-pxe-config-template')
|
||||
|
||||
def test_get_pxe_conf_option_agent_deploy_default(self):
|
||||
self.config(group='pxe', pxe_config_template='my-pxe-config-template')
|
||||
self._test_get_pxe_conf_option('fake_agent',
|
||||
'my-pxe-config-template')
|
||||
|
||||
def test_get_pxe_conf_option_agent_deploy_not_default(self):
|
||||
self.config(group='agent',
|
||||
agent_pxe_config_template='my-agent-config-template')
|
||||
self.config(group='pxe', pxe_config_template='my-pxe-config-template')
|
||||
self._test_get_pxe_conf_option('fake_agent',
|
||||
'my-agent-config-template')
|
||||
|
||||
def test__parse_driver_info_missing_deploy_kernel(self):
|
||||
del self.node.driver_info['deploy_kernel']
|
||||
self.assertRaises(exception.MissingParameterValue,
|
||||
|
@ -0,0 +1,9 @@
|
||||
---
|
||||
upgrade:
|
||||
- |
|
||||
In the configuration group ``[agent]``, the following options were
|
||||
deprecated in the Liberty cycle and they have been removed:
|
||||
|
||||
* ``[agent]/agent_pxe_append_params``
|
||||
* ``[agent]/agent_pxe_config_template``
|
||||
|
Loading…
Reference in New Issue
Block a user