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:
@@ -372,7 +372,13 @@ class LenovoFirmwareConfig(object):
|
|||||||
if not instances:
|
if not instances:
|
||||||
protect = True # not supported yet
|
protect = True # not supported yet
|
||||||
else:
|
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)
|
default = onedata.get('default', None)
|
||||||
if default == '':
|
if default == '':
|
||||||
default = None
|
default = None
|
||||||
|
Reference in New Issue
Block a user