2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-27 19:37:44 +00:00

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
This commit is contained in:
Jarrod Johnson 2018-02-07 15:26:56 -05:00
parent 53c1de0a16
commit 5821d0d729
2 changed files with 4 additions and 0 deletions

View File

@ -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(

View File

@ -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):