From f94a79a8215a6209833aad7acadb17b7f0c0758a Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 1 Dec 2022 11:40:26 -0500 Subject: [PATCH] Leave Purley generation on the IPMI path Purley has an incomplete redfish implementation for uefi settings, blacklist it from the new way of pushing settings. Reading settings seems fine, however. Change-Id: Ie8baf50e11b05e2cafa644c414970ceeaaa35dbf --- pyghmi/ipmi/oem/lenovo/config.py | 36 +++++++++++++++++++------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/pyghmi/ipmi/oem/lenovo/config.py b/pyghmi/ipmi/oem/lenovo/config.py index a3481d26..7439b058 100644 --- a/pyghmi/ipmi/oem/lenovo/config.py +++ b/pyghmi/ipmi/oem/lenovo/config.py @@ -568,19 +568,25 @@ class LenovoFirmwareConfig(object): data = EfiCompressor.FrameworkCompress(xml, len(xml)) bdata = base64.b64encode(data).decode('utf8') rsp = self.xc.grab_redfish_response_with_status( - '/redfish/v1/Systems/1/Actions/Oem/' - 'LenovoComputerSystem.DSWriteFile', - {'Action': 'DSWriteFile', 'Resize': len(data), - 'FileName': 'asu_update.efi', 'Content': bdata}) - if rsp[1] != 204: - if self.connection is None: - raise Unsupported('Not Supported') - 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) + '/redfish/v1/Managers/1') + if rsp[1] == 200: + if 'purley' not in rsp[0].get('Oem', {}).get('Lenovo', {}).get( + 'release_name', 'purley'): + rsp = self.xc.grab_redfish_response_with_status( + '/redfish/v1/Systems/1/Actions/Oem/' + 'LenovoComputerSystem.DSWriteFile', + {'Action': 'DSWriteFile', 'Resize': len(data), + 'FileName': 'asu_update.efi', 'Content': bdata}) + if rsp[1] == 204: + return True + if self.connection is None: + raise Unsupported('Not Supported') + 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