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
This commit is contained in:
Dmitry Tantsur 2023-11-27 15:50:27 +01:00
parent 281cebedd6
commit 203660a0be
No known key found for this signature in database
GPG Key ID: 315B2AF9FD216C60
4 changed files with 17 additions and 27 deletions

View File

@ -97,15 +97,14 @@ Deploy ramdisk images
#. Configure the Bare Metal service to use the produced images. It can be done #. 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 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 .. code-block:: ini
[conductor] [conductor]
deploy_kernel_by_arch = {'x86_64': <insert DEPLOY_VMLINUZ_X86_64_UUID>, deploy_kernel_by_arch = x86_64:<DEPLOY_VMLINUZ_X86_64_UUID>,aarch64:<DEPLOY_VMLINUZ_AARCH64_UUID>
'aarch64': <insert DEPLOY_VMLINUZ_AARCH64_UUID>} deploy_ramdisk_by_arch = x86_64:<DEPLOY_INITRD_X86_64_UUID>,aarch64:<DEPLOY_INITRD_AARCH64_UUID>
deploy_ramdisk_by_arch = {'x86_64': <insert DEPLOY_INITRD_X86_64_UUID>,
'aarch64': <insert DEPLOY_INITRD_AARCH64_UUID>}
or globally using the general configuration parameters: or globally using the general configuration parameters:

View File

@ -205,17 +205,11 @@ opts = [
'endpoint via multicast DNS.')), 'endpoint via multicast DNS.')),
cfg.StrOpt('deploy_kernel', cfg.StrOpt('deploy_kernel',
mutable=True, mutable=True,
deprecated_for_removal=True, help=_('Glance ID, http:// or file:// URL of the '
deprecated_reason=_('Replaced by deploy_kernel_by_arch which '
'provides more configuration options.'),
help=_('DEPRECATED: Glance ID, http:// or file:// URL of the '
'kernel of the default deploy image.')), 'kernel of the default deploy image.')),
cfg.StrOpt('deploy_ramdisk', cfg.StrOpt('deploy_ramdisk',
mutable=True, mutable=True,
deprecated_for_removal=True, help=_('Glance ID, http:// or file:// URL of the '
deprecated_reason=_('Replaced by deploy_ramdisk_by_arch which '
'provides more configuration options.'),
help=_('DEPRECATED: Glance ID, http:// or file:// URL of the '
'initramfs of the default deploy image.')), 'initramfs of the default deploy image.')),
cfg.DictOpt('deploy_kernel_by_arch', cfg.DictOpt('deploy_kernel_by_arch',
default={}, default={},
@ -231,17 +225,11 @@ opts = [
'initramfs of the default deploy image.')), 'initramfs of the default deploy image.')),
cfg.StrOpt('rescue_kernel', cfg.StrOpt('rescue_kernel',
mutable=True, mutable=True,
deprecated_for_removal=True, help=_('Glance ID, http:// or file:// URL of the '
deprecated_reason=_('Replaced by rescue_kernel_by_arch which '
'provides more configuration options.'),
help=_('DEPRECATED: Glance ID, http:// or file:// URL of the '
'kernel of the default rescue image.')), 'kernel of the default rescue image.')),
cfg.StrOpt('rescue_ramdisk', cfg.StrOpt('rescue_ramdisk',
mutable=True, mutable=True,
deprecated_for_removal=True, help=_('Glance ID, http:// or file:// URL of the '
deprecated_reason=_('Replaced by rescue_ramdisk_by_arch which '
'provides more configuration options.'),
help=_('DEPRECATED: Glance ID, http:// or file:// URL of the '
'initramfs of the default rescue image.')), 'initramfs of the default rescue image.')),
cfg.DictOpt('rescue_kernel_by_arch', cfg.DictOpt('rescue_kernel_by_arch',
default={}, default={},

View File

@ -463,12 +463,9 @@ def get_agent_kernel_ramdisk(node, mode='deploy', deprecated_prefix=None):
kernel_dict = getattr(CONF.conductor, kernel_dict_param_name) kernel_dict = getattr(CONF.conductor, kernel_dict_param_name)
ramdisk_dict = getattr(CONF.conductor, ramdisk_dict_param_name) ramdisk_dict = getattr(CONF.conductor, ramdisk_dict_param_name)
cpu_arch = node.properties.get('cpu_arch') cpu_arch = node.properties.get('cpu_arch')
kernel_for_this_arch = kernel_dict.get(cpu_arch) kernel = kernel_dict.get(cpu_arch) if cpu_arch else None
ramdisk_for_this_arch = ramdisk_dict.get(cpu_arch) ramdisk = ramdisk_dict.get(cpu_arch) if cpu_arch else None
if kernel_for_this_arch and ramdisk_for_this_arch: if not kernel or not ramdisk:
kernel = kernel_for_this_arch
ramdisk = ramdisk_for_this_arch
else:
kernel = getattr(CONF.conductor, kernel_name) kernel = getattr(CONF.conductor, kernel_name)
ramdisk = getattr(CONF.conductor, ramdisk_name) ramdisk = getattr(CONF.conductor, ramdisk_name)
return { return {

View File

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