2
0
mirror of https://opendev.org/x/pyghmi synced 2025-02-20 12:30:48 +00:00

Add clear system configuration to redfish

Implement clear uefi configuration for redfish targets

Change-Id: Id85c13b773597ae331902ae91ad3d8bcc0b9982b
This commit is contained in:
Jarrod Johnson 2019-04-15 14:22:11 -04:00
parent 60313e76c0
commit a05c044874

View File

@ -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')