Handle out of order setting instances
The data from the xClarity controller may not be sorted, apply numeric sort on the way out. Change-Id: Icd22a140bf6b558703b1006a41047ffbd6a1e3d8
This commit is contained in:
parent
584c109763
commit
ed94d36d18
@ -372,7 +372,13 @@ class LenovoFirmwareConfig(object):
|
||||
if not instances:
|
||||
protect = True # not supported yet
|
||||
else:
|
||||
current = [x.text for x in instances]
|
||||
instbynum = {}
|
||||
defidx = 1
|
||||
for x in instances:
|
||||
xid = int(x.get('ID', defidx))
|
||||
instbynum[xid] = x
|
||||
defidx += 1
|
||||
current = [instbynum[idx].text for idx in sorted(instbynum)]
|
||||
default = onedata.get('default', None)
|
||||
if default == '':
|
||||
default = None
|
||||
|
Loading…
x
Reference in New Issue
Block a user