diff options
Diffstat (limited to 'src/store')
-rw-r--r-- | src/store/modules/GlobalStore.js | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/store/modules/GlobalStore.js b/src/store/modules/GlobalStore.js index 879d8d89..1327422a 100644 --- a/src/store/modules/GlobalStore.js +++ b/src/store/modules/GlobalStore.js @@ -16,9 +16,11 @@ const hostStateMapper = hostState => { case 'Off': // Redfish PowerState return 'off'; case HOST_STATE.error: - // TODO: Map Redfish Quiesced when bmcweb supports + case 'Quiesced': // Redfish Status return 'error'; - // TODO: Add mapping for DiagnosticMode + case HOST_STATE.diagnosticMode: + case 'InTest': // Redfish Status + return 'diagnosticMode'; default: return 'unreachable'; } @@ -53,8 +55,15 @@ const GlobalStore = { getHostStatus({ commit }) { api .get('/redfish/v1/Systems/system') - .then(({ data: { PowerState } } = {}) => { - commit('setHostStatus', PowerState); + .then(({ data: { PowerState, Status: { State } = {} } } = {}) => { + if (State === 'Quiesced' || State === 'InTest') { + // OpenBMC's host state interface is mapped to 2 Redfish + // properties "Status""State" and "PowerState". Look first + // at State for certain cases. + commit('setHostStatus', State); + } else { + commit('setHostStatus', PowerState); + } }) .catch(error => console.log(error)); } |