From 5821d0d729ea7cf3930bd779fc2e7ef640607700 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 7 Feb 2018 15:26:56 -0500 Subject: [PATCH] Provide a sortid to preserve the settings order Some settings are logically grouped in a totally implicit way. Preserve the implicit ordering cue as needed. Change-Id: If0378549f16ede92e873920c0a751737fc3be68f --- pyghmi/ipmi/oem/lenovo/config.py | 3 +++ pyghmi/ipmi/oem/lenovo/imm.py | 1 + 2 files changed, 4 insertions(+) diff --git a/pyghmi/ipmi/oem/lenovo/config.py b/pyghmi/ipmi/oem/lenovo/config.py index b9ceca7a..871cc0fc 100644 --- a/pyghmi/ipmi/oem/lenovo/config.py +++ b/pyghmi/ipmi/oem/lenovo/config.py @@ -260,6 +260,7 @@ class LenovoFirmwareConfig(object): self.connection.ipmi_session.pause(2) xml = etree.fromstring(data) + sortid = 0 for config in xml.iter("config"): lenovo_id = config.get("ID") for group in config.iter("group"): @@ -320,7 +321,9 @@ class LenovoFirmwareConfig(object): lenovo_protect=protect, readonly_expression=readonly, hide_expression=hide, + sortid=sortid, lenovo_instance="") + sortid = sortid + 1 for opt in options: opt = options[opt] opt['hidden'], opt['hidden_why'] = _eval_conditional( diff --git a/pyghmi/ipmi/oem/lenovo/imm.py b/pyghmi/ipmi/oem/lenovo/imm.py index e8b8dc1f..6f4b767a 100644 --- a/pyghmi/ipmi/oem/lenovo/imm.py +++ b/pyghmi/ipmi/oem/lenovo/imm.py @@ -143,6 +143,7 @@ class IMMClient(object): retcfg[opt]['default'] = self.fwo[opt]['default'] retcfg[opt]['help'] = self.fwo[opt]['help'] retcfg[opt]['possible'] = self.fwo[opt]['possible'] + retcfg[opt]['sortid'] = self.fwo[opt]['sortid'] return retcfg def set_system_configuration(self, changeset):