From 7b5e6416355ac25e6cf27ba6545e7188a2ef25a1 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 17 Jan 2023 09:15:33 -0500 Subject: [PATCH] Avoid using broken UEFI configuration on Purley Purley has a partial implementation, must avoid trying to use it. Change-Id: I4291f425bf49b746f07d1204fbf89d650d3308b3 --- pyghmi/ipmi/oem/lenovo/config.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pyghmi/ipmi/oem/lenovo/config.py b/pyghmi/ipmi/oem/lenovo/config.py index 7439b058..818db0c7 100644 --- a/pyghmi/ipmi/oem/lenovo/config.py +++ b/pyghmi/ipmi/oem/lenovo/config.py @@ -272,8 +272,15 @@ class LenovoFirmwareConfig(object): options = {} data = None rsp = self.xc.grab_redfish_response_with_status( - '/redfish/v1/Systems/1/Actions/Oem/LenovoComputerSystem.DSReadFile', - {'Action': 'DSReadFile', 'FileName': cfgfilename}) + '/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.DSReadFile', + {'Action': 'DSReadFile', 'FileName': cfgfilename}) + else: + rsp = (None, 500) if rsp[1] == 200: data = rsp[0]['Content'] data = base64.b64decode(data)