From ccf5c5c83260aec703859f6e65075b3365897518 Mon Sep 17 00:00:00 2001 From: jason westover Date: Thu, 12 Sep 2024 17:18:59 -0500 Subject: [PATCH] Add default Target to MultipartHttpPush When no targets are provided, webui will now default to the BMC: i.e. "/redfish/v1/Managers/bmc" The current version of bmcweb requires the Targets parameter. bmcweb will be updated for multipart to match the behavior of simpleupdate: if Targets is empty or missing, default to the BMC. Also, the fwupdate page will be updated soon to allow the selection of Targets from the FirmwareInventory list. This should be a temp webui fix until we are comfortable with the upcoming changes to bmcweb. Change-Id: I630dcb40068b98aad8e1d276d17fe9af4793e788 Signed-off-by: jason westover --- src/store/modules/Operations/FirmwareStore.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/store/modules/Operations/FirmwareStore.js b/src/store/modules/Operations/FirmwareStore.js index 6c216da88c..64bd640fdb 100644 --- a/src/store/modules/Operations/FirmwareStore.js +++ b/src/store/modules/Operations/FirmwareStore.js @@ -141,7 +141,13 @@ const FirmwareStore = { const formData = new FormData(); formData.append('UpdateFile', image); let params = {}; - if (targets != null && targets.length > 0) params.Targets = targets; + if (targets != null && targets.length > 0) { + params.Targets = targets; + } else { + // TODO: Should be OK to leave Targets out, remove this clause + // when bmcweb is updated + params.Targets = [`${await this.dispatch('global/getBmcPath')}`]; + } formData.append('UpdateParameters', JSON.stringify(params)); return await api .post(state.multipartHttpPushUri, formData, {