diff --git a/confluent_server/aiohmi/ipmi/command.py b/confluent_server/aiohmi/ipmi/command.py index 8384bb62..d0151422 100644 --- a/confluent_server/aiohmi/ipmi/command.py +++ b/confluent_server/aiohmi/ipmi/command.py @@ -825,14 +825,19 @@ class Command(object): one byte, return the int value """ fetchcmd = bytearray((channel, param, 0, 0)) - try: - fetched = await self.oldraw_command(0xc, 2, data=fetchcmd) - except exc.IpmiException as ie: - if ie.ipmicode == 0x80: - return None - raise + fetched = await self.oldraw_command(0xc, 2, data=fetchcmd) + # A bmc without the parameter says so in the completion code and sends + # no data at all, so the code has to be read before the payload is. + # oldraw_command reports the code rather than raising on it, which is + # why this cannot be done by catching something. + if fetched['code'] in (0x80, 0xc9): + # parameter not supported, and parameter out of range + return None + if fetched['code']: + raise exc.IpmiException(util.get_ipmi_error(fetched), + fetched['code']) fetchdata = fetched['data'] - if bytearray(fetchdata)[0] != 17: + if not fetchdata or bytearray(fetchdata)[0] != 17: return None if param == 0x14: vlaninfo = struct.unpack('