From a05c04487424d8240046b7525f412b15e2adbeac Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 15 Apr 2019 14:22:11 -0400 Subject: [PATCH] Add clear system configuration to redfish Implement clear uefi configuration for redfish targets Change-Id: Id85c13b773597ae331902ae91ad3d8bcc0b9982b --- pyghmi/redfish/command.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pyghmi/redfish/command.py b/pyghmi/redfish/command.py index 758f93e9..14c985a1 100644 --- a/pyghmi/redfish/command.py +++ b/pyghmi/redfish/command.py @@ -469,6 +469,17 @@ class Command(object): currsettings[setting] = {'value': biosinfo['Attributes'][setting]} return currsettings + def clear_system_configuration(self): + """Clear the BIOS/UEFI configuration + + """ + biosinfo = self._do_web_request(self._biosurl) + rb = biosinfo.get('Actions', {}).get('#Bios.ResetBios', {}) + rb = rb.get('target', '') + if not rb: + raise Exception('BIOS reset not detected on this system') + self._do_web_request(rb, {'Action': 'Bios.ResetBios'}) + def set_system_configuration(self, changeset): redfishsettings = {'Attributes': changeset} self._do_web_request(self._setbiosurl, redfishsettings, 'PATCH')