From 9a5b0ccce2ed8f6afdbb6d332c73259381cb7c19 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 9 Apr 2025 15:42:59 -0400 Subject: [PATCH] Provide specific error when querying a bad bay in sharedio Change-Id: Id64fa502ac319d6671aaf15cf1cce927e3762d1a --- pyghmi/ipmi/oem/lenovo/nextscale.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pyghmi/ipmi/oem/lenovo/nextscale.py b/pyghmi/ipmi/oem/lenovo/nextscale.py index e0487db3..2d963e9a 100644 --- a/pyghmi/ipmi/oem/lenovo/nextscale.py +++ b/pyghmi/ipmi/oem/lenovo/nextscale.py @@ -762,7 +762,13 @@ class SMMClient(object): rsp = {'data': [1]} rsp['data'] = bytearray(rsp['data']) if rsp['data'][0] == 2: # shared io - rsp = self.ipmicmd.xraw_command(0x32, 0xa7, data=[bay - 1]) + try: + rsp = self.ipmicmd.xraw_command(0x32, 0xa7, data=[bay - 1]) + except Exception: + raise Exception('Shared IO detected trying to reseat {}, ' + 'but unable to determine status of ' + 'partner bay {}'.format( + bay, bay - 1)) rsp['data'] = bytearray(rsp['data']) if rsp['data'][1] == 0x80: raise Exception('Unable to reseat bay {0} due to bay {1} '