From 03aabc6fd33509ff515a3a14452b6a200b672192 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 11 Apr 2019 10:38:21 -0400 Subject: [PATCH] Protect more unspported instance variables A new category of settings have instances without declaring maximum instances. Autosense and hide these sorts of settings. Change-Id: I5334d6fad76454674dc0c1ffa094c2178e950c66 --- pyghmi/ipmi/oem/lenovo/config.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pyghmi/ipmi/oem/lenovo/config.py b/pyghmi/ipmi/oem/lenovo/config.py index 7eaf82e0..48f515a3 100644 --- a/pyghmi/ipmi/oem/lenovo/config.py +++ b/pyghmi/ipmi/oem/lenovo/config.py @@ -305,6 +305,9 @@ class LenovoFirmwareConfig(object): name = setting.find("mriName").text help = setting.find("desc").text onedata = setting.find('text_data') + if onedata: + if len(list(onedata.iter('instance'))) > 1: + protect = True if onedata is not None: if onedata.get('password') == 'true': protect = True @@ -312,6 +315,10 @@ class LenovoFirmwareConfig(object): if enumdata is not None: if enumdata.get('maxinstance') is not None: protect = True + for currchoice in enumdata.iter('choice'): + if len(list(currchoice.iter('instance'))) > 1: + protect = True + break if onedata is None: onedata = setting.find('numeric_data') if onedata is not None: