Skip to content

Commit 47c46eb

Browse files
authored
Added 30 secs delay for Updating Network IPMI (out-of-band IPMI) protocol (#127)
* added 30 secs delay for network protocol * updated success message * added 30 secs delay for ssh protocol * reverted the changes for ssh BMC shell protocol
1 parent 4a4bb1c commit 47c46eb

File tree

3 files changed

+29
-7
lines changed

3 files changed

+29
-7
lines changed

src/locales/en-US.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1274,8 +1274,9 @@
12741274
"toast": {
12751275
"errorNetworkPolicyUpdate": "Error updating %{policy}.",
12761276
"successDisableBmcShell": "Successfully disabled BMC shell (via SSH), Please allow 15 seconds for the disable to become effective.",
1277-
"successEnableBmcShell": "Successfully enabled BMC shell (via SSH)",
1277+
"successEnableBmcShell": "Successfully enabled BMC shell (via SSH).",
12781278
"successNetworkPolicyUpdate": "Successfully updated %{policy}.",
1279+
"successIpmiNetworkPolicyUpdate": "Successfully updated %{policy}. The BMC normally takes about 30 seconds to change the state.",
12791280
"successNextBootToast": "Applying changes to %{policy}. Changes made to %{policy} will take effect on next reboot."
12801281
},
12811282
"acfUploadEnablementConfirmText": "Caution: Enabling this setting allows unauthenticated users to upload Access Control Files (ACFs) without logging in and without pressing Function 74 on the Operator Panel. Do you want to proceed?",

src/store/modules/SecurityAndAccess/PoliciesStore.js

+11-2
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,12 @@ const PoliciesStore = {
189189
);
190190
});
191191
},
192-
async saveIpmiProtocolState({ commit }, protocolEnabled) {
192+
async getNetworkProtocolStatusAfterDelay({ dispatch }) {
193+
setTimeout(() => {
194+
dispatch('getNetworkProtocolStatus');
195+
}, 30000);
196+
},
197+
async saveIpmiProtocolState({ commit, dispatch }, protocolEnabled) {
193198
commit('setIpmiProtocolEnabled', protocolEnabled);
194199
const ipmi = {
195200
IPMI: {
@@ -199,7 +204,11 @@ const PoliciesStore = {
199204
return await api
200205
.patch('/redfish/v1/Managers/bmc/NetworkProtocol', ipmi)
201206
.then(() => {
202-
return i18n.t('pagePolicies.toast.successNetworkPolicyUpdate', {
207+
// Getting protocol data here so that the Ipmi gets enabled/disabled
208+
dispatch('getNetworkProtocolStatusAfterDelay');
209+
})
210+
.then(() => {
211+
return i18n.t('pagePolicies.toast.successIpmiNetworkPolicyUpdate', {
203212
policy: i18n.t('pagePolicies.ipmi'),
204213
});
205214
})

src/views/SecurityAndAccess/Policies/Policies.vue

+16-4
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,9 @@ export default {
349349
this.startLoader();
350350
Promise.all([
351351
this.$store.dispatch('policies/getBiosStatus'),
352-
this.$store.dispatch('policies/getNetworkProtocolStatus'),
352+
setTimeout(() => {
353+
this.$store.dispatch('policies/getNetworkProtocolStatus');
354+
}, 30000),
353355
this.$store.dispatch('policies/getUsbFirmwareUpdatePolicyEnabled'),
354356
this.$store.dispatch('policies/getUnauthenticatedACFUploadEnablement'),
355357
this.$store.dispatch('policies/getTpmPolicy'),
@@ -359,7 +361,9 @@ export default {
359361
this.unauthenticatedACFUploadEnablementState = this.$store.getters[
360362
'policies/acfUploadEnablement'
361363
];
362-
this.endLoader();
364+
setTimeout(() => {
365+
this.endLoader();
366+
}, 30000);
363367
});
364368
},
365369
methods: {
@@ -378,13 +382,21 @@ export default {
378382
changeIpmiProtocolState(state) {
379383
this.$store
380384
.dispatch('policies/saveIpmiProtocolState', state)
381-
.then((message) => this.successToast(message))
385+
.then((message) => {
386+
this.startLoader();
387+
setTimeout(() => {
388+
this.endLoader();
389+
}, 30000);
390+
this.successToast(message);
391+
})
382392
.catch(({ message }) => this.errorToast(message));
383393
},
384394
changeSshProtocolState(state) {
385395
this.$store
386396
.dispatch('policies/saveSshProtocolState', state)
387-
.then((message) => this.successToast(message))
397+
.then((message) => {
398+
this.successToast(message);
399+
})
388400
.catch(({ message }) => this.errorToast(message));
389401
},
390402
changeRtadState(state) {

0 commit comments

Comments
 (0)