2
0
mirror of https://opendev.org/x/pyghmi synced 2025-11-02 12:22:27 +00:00

Provide better error handling for XCC/IMM

The UEFI configuration can fail out.

Change-Id: I0e6fc5630f6bb9df02512b8d3a3818e5f1d283a0
This commit is contained in:
Jarrod Johnson
2019-06-07 17:02:28 -04:00
parent f24d199b7b
commit b1a430cf3b
2 changed files with 6 additions and 2 deletions

View File

@@ -268,7 +268,8 @@ class LenovoFirmwareConfig(object):
if len(data) != 0:
break
self.connection.ipmi_session.pause(2)
if not data:
raise Exception("BMC failed to return configuration information")
xml = etree.fromstring(data)
sortid = 0
for config in xml.iter("config"):

View File

@@ -171,7 +171,10 @@ class IMMClient(object):
def get_system_configuration(self, hideadvanced=True):
if not self.fwc:
self.fwc = config.LenovoFirmwareConfig(self.ipmicmd)
self.fwo = self.fwc.get_fw_options()
try:
self.fwo = self.fwc.get_fw_options()
except Exception:
raise Exception(self.bmcname + ' failed to retrieve UEFI configuration')
self.fwovintage = util._monotonic_time()
retcfg = {}
for opt in self.fwo: