Add retry logic to web fetch
While UEFI configuration is always handy, reads to the IMM section may require wait and retry. Change-Id: I7fe97124897fca6e928c3699171bfbe676d699e1
This commit is contained in:
parent
e4a48e9072
commit
44733d19b0
@ -23,6 +23,7 @@ import random
|
|||||||
import struct
|
import struct
|
||||||
|
|
||||||
import six
|
import six
|
||||||
|
import time
|
||||||
|
|
||||||
import pyghmi.exceptions as pygexc
|
import pyghmi.exceptions as pygexc
|
||||||
|
|
||||||
@ -285,9 +286,19 @@ class LenovoFirmwareConfig(object):
|
|||||||
else:
|
else:
|
||||||
rsp = (None, 500)
|
rsp = (None, 500)
|
||||||
if rsp[1] == 200:
|
if rsp[1] == 200:
|
||||||
data = rsp[0]['Content']
|
for _ in range(0, 30):
|
||||||
data = base64.b64decode(data)
|
data = rsp[0]['Content']
|
||||||
data = EfiCompressor.FrameworkDecompress(data, len(data))
|
data = base64.b64decode(data)
|
||||||
|
data = EfiCompressor.FrameworkDecompress(data, len(data))
|
||||||
|
if len(data) != 0:
|
||||||
|
break
|
||||||
|
if self.connection:
|
||||||
|
self.connection.ipmi_session.pause(2)
|
||||||
|
else:
|
||||||
|
time.sleep(2)
|
||||||
|
rsp = self.xc.grab_redfish_response_with_status(
|
||||||
|
'/redfish/v1/Systems/1/Actions/Oem/LenovoComputerSystem.DSReadFile',
|
||||||
|
{'Action': 'DSReadFile', 'FileName': cfgfilename})
|
||||||
else:
|
else:
|
||||||
if self.connection is None:
|
if self.connection is None:
|
||||||
raise Unsupported('Not Supported')
|
raise Unsupported('Not Supported')
|
||||||
|
Loading…
Reference in New Issue
Block a user