From 203660a0be56c1434605c948ec95df99b74b138d Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Mon, 27 Nov 2023 15:50:27 +0100 Subject: [PATCH] Fix *_by_arch documentation and un-deprecate the options without it First, the *_by_arch options are not a replacement for plain options: the cpu_arch property is neither required not standardized. This is why older options with *_by_arch equivalents are not deprecated. Second, the example in the documentation is wrong: oslo.config does not use Python dictionaries. Which makes me suspect that the feature has never been properly tested (indeed, it's not used in the devstack CI, and Bifrost uses the older options). Change-Id: If1e633930909ce9d80e14f3ec3daa0bf8d48b7f0 --- .../install/configure-glance-images.rst | 9 ++++----- ironic/conf/conductor.py | 20 ++++--------------- ironic/drivers/utils.py | 9 +++------ .../deploy-kernels-8998a9c301db483b.yaml | 6 ++++++ 4 files changed, 17 insertions(+), 27 deletions(-) create mode 100644 releasenotes/notes/deploy-kernels-8998a9c301db483b.yaml diff --git a/doc/source/install/configure-glance-images.rst b/doc/source/install/configure-glance-images.rst index 62d1bd8e57..5cdecfad2c 100644 --- a/doc/source/install/configure-glance-images.rst +++ b/doc/source/install/configure-glance-images.rst @@ -97,15 +97,14 @@ Deploy ramdisk images #. Configure the Bare Metal service to use the produced images. It can be done per node as described in :doc:`enrollment` or in the configuration - file either using a dictionary to specify them by architecture as follows: + file either using a dictionary to specify them by architecture (matching + the node's ``cpu_arch`` property) as follows: .. code-block:: ini [conductor] - deploy_kernel_by_arch = {'x86_64': , - 'aarch64': } - deploy_ramdisk_by_arch = {'x86_64': , - 'aarch64': } + deploy_kernel_by_arch = x86_64:,aarch64: + deploy_ramdisk_by_arch = x86_64:,aarch64: or globally using the general configuration parameters: diff --git a/ironic/conf/conductor.py b/ironic/conf/conductor.py index 416d30ccb0..3c6261536f 100644 --- a/ironic/conf/conductor.py +++ b/ironic/conf/conductor.py @@ -205,17 +205,11 @@ opts = [ 'endpoint via multicast DNS.')), cfg.StrOpt('deploy_kernel', mutable=True, - deprecated_for_removal=True, - deprecated_reason=_('Replaced by deploy_kernel_by_arch which ' - 'provides more configuration options.'), - help=_('DEPRECATED: Glance ID, http:// or file:// URL of the ' + help=_('Glance ID, http:// or file:// URL of the ' 'kernel of the default deploy image.')), cfg.StrOpt('deploy_ramdisk', mutable=True, - deprecated_for_removal=True, - deprecated_reason=_('Replaced by deploy_ramdisk_by_arch which ' - 'provides more configuration options.'), - help=_('DEPRECATED: Glance ID, http:// or file:// URL of the ' + help=_('Glance ID, http:// or file:// URL of the ' 'initramfs of the default deploy image.')), cfg.DictOpt('deploy_kernel_by_arch', default={}, @@ -231,17 +225,11 @@ opts = [ 'initramfs of the default deploy image.')), cfg.StrOpt('rescue_kernel', mutable=True, - deprecated_for_removal=True, - deprecated_reason=_('Replaced by rescue_kernel_by_arch which ' - 'provides more configuration options.'), - help=_('DEPRECATED: Glance ID, http:// or file:// URL of the ' + help=_('Glance ID, http:// or file:// URL of the ' 'kernel of the default rescue image.')), cfg.StrOpt('rescue_ramdisk', mutable=True, - deprecated_for_removal=True, - deprecated_reason=_('Replaced by rescue_ramdisk_by_arch which ' - 'provides more configuration options.'), - help=_('DEPRECATED: Glance ID, http:// or file:// URL of the ' + help=_('Glance ID, http:// or file:// URL of the ' 'initramfs of the default rescue image.')), cfg.DictOpt('rescue_kernel_by_arch', default={}, diff --git a/ironic/drivers/utils.py b/ironic/drivers/utils.py index 2a62cd54b2..642bdb33f6 100644 --- a/ironic/drivers/utils.py +++ b/ironic/drivers/utils.py @@ -463,12 +463,9 @@ def get_agent_kernel_ramdisk(node, mode='deploy', deprecated_prefix=None): kernel_dict = getattr(CONF.conductor, kernel_dict_param_name) ramdisk_dict = getattr(CONF.conductor, ramdisk_dict_param_name) cpu_arch = node.properties.get('cpu_arch') - kernel_for_this_arch = kernel_dict.get(cpu_arch) - ramdisk_for_this_arch = ramdisk_dict.get(cpu_arch) - if kernel_for_this_arch and ramdisk_for_this_arch: - kernel = kernel_for_this_arch - ramdisk = ramdisk_for_this_arch - else: + kernel = kernel_dict.get(cpu_arch) if cpu_arch else None + ramdisk = ramdisk_dict.get(cpu_arch) if cpu_arch else None + if not kernel or not ramdisk: kernel = getattr(CONF.conductor, kernel_name) ramdisk = getattr(CONF.conductor, ramdisk_name) return { diff --git a/releasenotes/notes/deploy-kernels-8998a9c301db483b.yaml b/releasenotes/notes/deploy-kernels-8998a9c301db483b.yaml new file mode 100644 index 0000000000..eeedcc9f25 --- /dev/null +++ b/releasenotes/notes/deploy-kernels-8998a9c301db483b.yaml @@ -0,0 +1,6 @@ +--- +deprecations: + - | + The ``deploy_kernel``, ``deploy_ramdisk``, ``rescue_kernel`` and + ``rescue_ramdisk`` configuration options, incorrectly deprecated in the + 2023.2 release series, are no longer deprecated.