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 <jwestover@nvidia.com>
diff --git a/src/store/modules/Operations/FirmwareStore.js b/src/store/modules/Operations/FirmwareStore.js
index 6c216da..64bd640 100644
--- a/src/store/modules/Operations/FirmwareStore.js
+++ b/src/store/modules/Operations/FirmwareStore.js
@@ -141,7 +141,13 @@
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, {