From 5c2c5d797f932eda0279a78152b0c564881f116d Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 1 May 2019 11:06:02 -0400 Subject: [PATCH] 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 --- pyghmi/redfish/command.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pyghmi/redfish/command.py b/pyghmi/redfish/command.py index f1232883..9133ccc8 100644 --- a/pyghmi/redfish/command.py +++ b/pyghmi/redfish/command.py @@ -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