From 9e51f88a20b236d668c7b7182a4114a5c646e328 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 11 Apr 2019 17:15:14 -0400 Subject: [PATCH] If no u-height, revert to default behavior Change-Id: I94dd5c8dd5b535c39b4b3df579961620e470c31b --- pyghmi/ipmi/oem/lenovo/imm.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyghmi/ipmi/oem/lenovo/imm.py b/pyghmi/ipmi/oem/lenovo/imm.py index 85be1841..174887c4 100644 --- a/pyghmi/ipmi/oem/lenovo/imm.py +++ b/pyghmi/ipmi/oem/lenovo/imm.py @@ -786,6 +786,8 @@ class XCCClient(IMMClient): def get_description(self): dsc = self.wc.grab_json_response('/DeviceDescription.json') dsc = dsc[0] + if not dsc.get('u-height', None): + return {} return {'height': int(dsc['u-height']), 'slot': int(dsc['slot'])} def clear_system_configuration(self):