mirror of
https://opendev.org/x/pyghmi
synced 2025-02-26 15:21:05 +00:00
Fix numeric indexs into configuration
Settings may dictate the index, and we must preserve that. Change-Id: Idd010e81013df26bcddb12f1654f259175e4dd70
This commit is contained in:
parent
345fd8b44e
commit
4bbf63c96b
@ -351,6 +351,7 @@ class LenovoFirmwareConfig(object):
|
||||
readonly = 'true'
|
||||
possible = []
|
||||
current = None
|
||||
currentidxes = []
|
||||
default = None
|
||||
reset = False
|
||||
name = setting.find("mriName").text
|
||||
@ -381,6 +382,7 @@ class LenovoFirmwareConfig(object):
|
||||
instbynum[xid] = x
|
||||
defidx += 1
|
||||
current = [instbynum[idx].text for idx in sorted(instbynum)]
|
||||
currentidxes = list(sorted(instbynum))
|
||||
default = onedata.get('default', None)
|
||||
if default == '':
|
||||
default = None
|
||||
@ -442,6 +444,8 @@ class LenovoFirmwareConfig(object):
|
||||
if current and len(current) > 1:
|
||||
instidx = 1
|
||||
for inst in current:
|
||||
if currentidxes:
|
||||
instidx = currentidxes.pop(0)
|
||||
optname = '{0}.{1}'.format(optionname, instidx)
|
||||
options[optname] = dict(
|
||||
current=inst,
|
||||
|
Loading…
x
Reference in New Issue
Block a user