From 79830da7d1f81a5bc71fceec4564c21af40e6d74 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 21 Jun 2019 09:08:20 -0400 Subject: [PATCH] Fix instances with no agentless update adapter Some XCC platforms and all IMM platforms cannot use the firmware update url. Change-Id: If6395df9f087626427118d73abbd33e20ecb7b0f --- pyghmi/ipmi/oem/lenovo/imm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyghmi/ipmi/oem/lenovo/imm.py b/pyghmi/ipmi/oem/lenovo/imm.py index 03af18ef..5c947d64 100644 --- a/pyghmi/ipmi/oem/lenovo/imm.py +++ b/pyghmi/ipmi/oem/lenovo/imm.py @@ -482,7 +482,7 @@ class IMMClient(object): fwu = self.wc.grab_json_response(self.ADP_FU_URL, referer=self.adp_referer) else: - fwu = None + fwu = {} if adapterdata: self.datacache['lenovo_cached_adapters_fu'] = ( (adapterdata, fwu), util._monotonic_time()) @@ -520,7 +520,7 @@ class IMMClient(object): except ValueError: pass yield ('{0} {1}'.format(aname, fname), bdata) - for fwi in fwu.get('items'): + for fwi in fwu.get('items', []): if fwi.get('key', -1) == adata.get('key', -2): if fwi.get('fw_status', 0) == 2: bdata = {}