2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-06-08 08:38:33 +00:00

Bring changes forward from pyghmi

HTTP boot enablement and fixes for the firmware parameters.
This commit is contained in:
Jarrod Johnson
2026-06-04 08:27:03 -04:00
parent 1aca69fd14
commit 86abdc4257
5 changed files with 15 additions and 5 deletions
+1
View File
@@ -54,6 +54,7 @@ boot_devices = {
'net': 4,
'network': 4,
'pxe': 4,
'http': 4,
'hd': 8,
'safe': 0xc,
'cd': 0x14,
@@ -61,6 +61,7 @@ boot_devices_read = {
'Pxe': 'network',
'Usb': 'usb',
'SDCard': 'sdcard',
'UefiHttp': 'http',
}
@@ -118,6 +118,7 @@ boot_devices_write = {
'setup': 'BiosSetup',
'bios': 'BiosSetup',
'f1': 'BiosSetup',
'http': 'UefiHttp',
}
boot_devices_read = {
@@ -129,6 +130,7 @@ boot_devices_read = {
'Pxe': 'network',
'Usb': 'usb',
'SDCard': 'sdcard',
'UefiHttp': 'http',
}
@@ -747,6 +749,11 @@ class OEMHandler(object):
raise exc.InvalidParameterValue('Unsupported device %s'
% repr(bootdev))
bootdev = boot_devices_write.get(bootdev, bootdev)
if bootdev == 'UefiHttp': # not universally supported, remap to Pxe
sysinfo = await self.sysinfo()
allowed = sysinfo.get('Boot', {}).get('BootSourceOverrideTarget@Redfish.AllowableValues', [])
if 'UefiHttp' not in allowed:
bootdev = 'Pxe'
if bootdev == 'None':
payload = {'Boot': {'BootSourceOverrideEnabled': 'Disabled'}}
else:
@@ -985,7 +992,8 @@ class OEMHandler(object):
return None
async def get_description(self):
for chassis in fishclient.sysinfo.get('Links', {}).get('Chassis', []):
sysinfo = await self.sysinfo()
for chassis in sysinfo.get('Links', {}).get('Chassis', []):
chassisurl = chassis['@odata.id']
chassisinfo = await self._do_web_request(chassisurl)
hmm = chassisinfo.get('HeightMm', None)
@@ -442,7 +442,7 @@ class TsmHandler(generic.OEMHandler):
self._wc = wc
return wc
async def update_firmware(self, filename, data=None, progress=None, bank=None):
async def update_firmware(self, filename, data=None, progress=None, bank=None, otherfields=None):
wc = await self.get_wc()
wc.set_header('Content-Type', 'application/json')
basefilename = os.path.basename(filename)
@@ -1302,7 +1302,7 @@ class OEMHandler(generic.OEMHandler):
if progress:
progress({'phase': 'complete'})
async def redfish_update_firmware(self, usd, filename, data, progress, bank):
async def redfish_update_firmware(self, usd, filename, data, progress, bank, otherfields=None):
if usd['HttpPushUriTargetsBusy']:
raise pygexc.TemporaryError('Cannot run multtiple updates to '
'same target concurrently')
@@ -1417,14 +1417,14 @@ class OEMHandler(generic.OEMHandler):
'/redfish/v1/UpdateService',
{'HttpPushUriTargets': []}, method='PATCH')
async def update_firmware(self, filename, data=None, progress=None, bank=None):
async def update_firmware(self, filename, data=None, progress=None, bank=None, otherfields=None):
result = None
wc = await self.wc()
usd = await self._do_web_request('/redfish/v1/UpdateService')
rfishurl = usd.get('HttpPushUri', None)
if rfishurl:
return await self.redfish_update_firmware(
usd, filename, data, progress, bank)
usd, filename, data, progress, bank, otherfields)
if self.updating:
raise pygexc.TemporaryError('Cannot run multiple updates to same '
'target concurrently')