Merge "fix: bios fields could not be fetched via the API"

This commit is contained in:
Zuul 2026-01-07 22:11:52 +00:00 committed by Gerrit Code Review
commit e76ff8222c
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>`_.