From d34cb35f98e60aee6c0b4ab1eddf4e11ac6dfd2e Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Fri, 14 Aug 2026 02:56:19 +0200 Subject: [PATCH] Treat a bios link that is not served as no bios link This bmc advertises a Bios resource on its system and answers 404 for it. Confluent followed the link and passed the bmc's complaint on as an unexpected error, so a nodeconfig read printed every bmc setting and then ended with "The requested resource of type named 'Bios' was not found", and the system half of the configuration was a 500 saying the same. There is already a good answer for a system that offers no bios settings, and a link that is advertised and not served is the same thing as far as a caller is concerned, so give it the same one. The result is checked once and remembered, including the negative, so this costs one request on the first ask and nothing after. --- confluent_server/aiohmi/redfish/command.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/confluent_server/aiohmi/redfish/command.py b/confluent_server/aiohmi/redfish/command.py index 66ee07ae..72360801 100644 --- a/confluent_server/aiohmi/redfish/command.py +++ b/confluent_server/aiohmi/redfish/command.py @@ -688,11 +688,22 @@ class Command(object): return await oem.set_bootdev(bootdev, persist, uefiboot, self) async def get_biosurl(self): - if not self._varbiosurl: - sysinfo = await self.sysinfo() - self._varbiosurl = sysinfo.get('Bios', {}).get('@odata.id', - None) if self._varbiosurl is None: + sysinfo = await self.sysinfo() + biosurl = sysinfo.get('Bios', {}).get('@odata.id', '') + if biosurl: + # A link may be advertised and not served. To a caller that is + # the same as not having one, so answer the same way rather + # than passing the bmc's complaint on as an unexpected error. + try: + await self._do_web_request(biosurl) + except exc.RedfishError as re: + if 'ResourceNotFound' not in str(re.msgid): + raise + biosurl = '' + # '' is remembered as 'asked, and there is none' + self._varbiosurl = biosurl + if not self._varbiosurl: raise exc.UnsupportedFunctionality( 'Bios management not detected on this platform') return self._varbiosurl