From ee4219766a28108aca1e4c8c2ea6c6b6eb6579b4 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 28 Aug 2019 15:50:23 -0400 Subject: [PATCH] Convert integer when advertised Rather than passing a value through, cast to int if the registry is available and instructs us to do so. Change-Id: I1b057f15278ba0cd0e98d23b073e3333fb896589 --- pyghmi/redfish/command.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pyghmi/redfish/command.py b/pyghmi/redfish/command.py index 94193866..6c94045d 100644 --- a/pyghmi/redfish/command.py +++ b/pyghmi/redfish/command.py @@ -1001,6 +1001,11 @@ class Command(object): ','.join(currsettings[change]['possible']))) if changeset[change] in reginfo[2].get(change, {}): changeset[change] = reginfo[2][change][changeset[change]] + for regentry in reginfo[3].get('Attributes', []): + if change in (regentry.get('AttributeName', ''), + regentry.get('DisplayName', '')): + if regentry.get('Type', None) == 'Integer': + changeset[change] = int(changeset[change]) redfishsettings = {'Attributes': changeset} self._do_web_request(self._setbiosurl, redfishsettings, 'PATCH')