fix: bios fields could not be fetched via the API

In Ie86ec57e428e2bb2efd099a839105e51a94824ab this code was added but it
appears to have been targeting an earlier version of the spec index
Ib93e62076207e3e25960111bd0b46b83fe481c69. Up to version 8 of the spec
there is mention of a 'registry' DB field which would have been added
and then parsed in a get_registry_fields() helper method. But it was
ultimately dropped. This bit of code still contained those references
resulting in the endpoint returning errors.

Closes-Bug: 2137596
Change-Id: I79ed016edd2ea6bfb94bf303f1e815b4d9b16dfd
Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
This commit is contained in:
Doug Goldstein 2026-01-06 16:26:45 -06:00
parent 5f59aa0b28
commit aa748ea919
No known key found for this signature in database
2 changed files with 8 additions and 7 deletions

View file

@ -129,9 +129,6 @@ class BIOSSetting(base.IronicObject):
the same, older, or newer than the version of the object. This is
used for DB interactions as well as for serialization/deserialization.
Version 1.1: remove registry field for unsupported versions if
remove_unavailable_fields is True.
:param target_version: the desired version of the object
:param remove_unavailable_fields: True to remove fields that are
unavailable in the target version; set this to True when
@ -140,20 +137,18 @@ class BIOSSetting(base.IronicObject):
"""
target_version = versionutils.convert_version_to_tuple(target_version)
for field in self.get_registry_fields():
for field in self.registry_fields:
field_is_set = self.obj_attr_is_set(field)
if target_version >= (1, 1):
# target version supports the major/minor specified
if not field_is_set:
# set it to its default value if it is not set
setattr(self, field, None)
# target version does not support the field, and it is set
elif field_is_set:
# target version does not support the field, and it is set
if remove_unavailable_fields:
# (De)serialising: remove unavailable fields
delattr(self, field)
elif self.registry:
setattr(self, field, None)
@base.IronicObjectRegistry.register

View file

@ -0,0 +1,6 @@
---
fixes:
- |
Fix retrieving BIOS settings via redfish based interfaces. The code used
some references to an earlier version of the spec which was ultimately
not adopted. Fixes `bug 2137596 <https://bugs.launchpad.net/ironic/+bug/2137596>`_.