2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-31 05:17:39 +00:00

Revise strategy for configuration robustness

This has negligible performance impact, but
may confer the same benefit as the slow
workaround done before.

Change-Id: I400646ea1004b21ec381867dab09589e5ee209ed
This commit is contained in:
Jarrod Johnson 2021-02-03 08:44:48 -05:00
parent 6542e7cc20
commit 1314c4cb22
2 changed files with 6 additions and 13 deletions

View File

@ -548,5 +548,9 @@ class LenovoFirmwareConfig(object):
filehandle = self.imm_open("asu_update.efi", write=True,
size=len(data))
self.imm_write(filehandle, len(data), data)
stubread = len(data)
if stubread > 8:
stubread = 8
self.imm_read(filehandle, stubread)
self.imm_close(filehandle)
return True

View File

@ -254,23 +254,12 @@ class IMMClient(object):
raise pygexc.InvalidParameterValue(
'{0} not a known setting'.format(key))
self.merge_changeset(changeset)
changepending = True
if changeset:
try:
changepending = self.fwc.set_fw_options(self.fwo)
except Exception:
self.fwc.set_fw_options(self.fwo)
finally:
self.fwo = None
self.fwovintage = 0
raise
giveup = util._monotonic_time() + 60
while changeset and changepending:
ipmisession.Session.pause(1)
self.fwo = self.fwc.get_fw_options(fetchimm=fetchimm)
self.fwovintage = util._monotonic_time()
if self.fwovintage > giveup:
break
self.merge_changeset(changeset)
changepending = self.fwc.set_fw_options(self.fwo, checkonly=True)
def merge_changeset(self, changeset):
for key in changeset: