Merge "Remove two DEPRECATED config options from [agent]"

This commit is contained in:
Jenkins 2016-04-22 14:00:48 +00:00 committed by Gerrit Code Review
commit 13a2609d60
7 changed files with 11 additions and 119 deletions

View File

@ -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::

View File

@ -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)

View File

@ -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',

View File

@ -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)

View File

@ -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.

View File

@ -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,

View File

@ -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``