From 8de6c56998262dee0c80ab0b92d1bb72d69c4b1f Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Fri, 14 Aug 2026 02:06:24 +0200 Subject: [PATCH] Say what is missing when sensor records cannot be read A bmc that keeps its sensor data records on the sensor device rather than in a repository was answered with a bare NotImplementedError. With no text of its own it reached the user as "Unexpected Error: NotImplementedError" and was logged with a traceback, for a capability the library had simply never implemented rather than anything having gone wrong. Say so instead, in all three places that give up: the two branches for a bmc without an sdr repository, and the version check that only understands records of version 0x51, which now names the version it was given. This makes the inventory usable on such a bmc as a side effect. The system fru is gathered before the records are, and an unsupported operation is tolerated where an unexpected error was not, so nodeinventory answers with the board, chassis and product data instead of one line of error. --- confluent_server/aiohmi/ipmi/sdr.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/confluent_server/aiohmi/ipmi/sdr.py b/confluent_server/aiohmi/ipmi/sdr.py index fcf05d3c..2fc573f7 100644 --- a/confluent_server/aiohmi/ipmi/sdr.py +++ b/confluent_server/aiohmi/ipmi/sdr.py @@ -687,11 +687,15 @@ class SDR(object): # The device has sensor device support, so in theory we should # be able to proceed # However at the moment, we haven't done so - raise NotImplementedError - return + raise exc.UnsupportedFunctionality( + 'This bmc keeps its sensor data records on the sensor ' + 'device rather than in a repository, which is not ' + 'supported') # We have Device SDR, without SDR Repository device, but # also without sensor device support, no idea how to # continue + raise exc.UnsupportedFunctionality( + 'This bmc offers no way to read its sensor data records') await self.get_sdr() async def get_sdr_reservation(self): @@ -706,7 +710,9 @@ class SDR(object): if (repinfo['data'][0] != 0x51): # we only understand SDR version 51h, the only version defined # at time of this writing - raise NotImplementedError + raise exc.UnsupportedFunctionality( + 'This bmc reports sensor data record version {0:#x}, and only ' + '0x51 is understood'.format(repinfo['data'][0])) # NOTE(jbjohnso): we actually don't need to care about 'numrecords' # since FFFF marks the end explicitly # numrecords = (rsp['data'][2] << 8) + rsp['data'][1]