2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-14 03:37:47 +00:00

Get pending settings with current

To be consistent with the ipmi settings, present the pending
as the 'value' and 'active' for the current value for pending
settings.

Change-Id: Ia99374732f05509d2796b5e2166c686716e93c69
This commit is contained in:
Jarrod Johnson 2019-05-01 11:06:02 -04:00
parent 1988c09d48
commit 5c2c5d797f

View File

@ -601,10 +601,18 @@ class Command(object):
reguri = reg['Uri']
extrainfo, valtodisplay, _ = self._get_biosreg(reguri)
currsettings = {}
pendingsettings = self._do_web_request(self._setbiosurl)
pendingsettings = pendingsettings.get('Attributes', {})
for setting in biosinfo.get('Attributes', {}):
val = biosinfo['Attributes'][setting]
currval = val
if setting in pendingsettings:
val = pendingsettings[setting]
val = valtodisplay.get(setting, {}).get(val, val)
currval = valtodisplay.get(setting, {}).get(currval, currval)
val = {'value': val}
if currval != val['value']:
val['active'] = currval
val.update(**extrainfo.get(setting, {}))
currsettings[setting] = val
return currsettings