Move to new ThermalSubsystem
Remove VUE_APP_FAN_DATA_FROM_THERMAL_SUBSYSTEM. Assume any Redfish
implementation we are using has the new ThermalSubsystem. bmcweb, the
only webserver, webui-vue supports today, enabled this by default at
https://gerrit.openbmc.org/c/openbmc/bmcweb/+/69228
ThermalSubsystem, PowerSubsystem has been out since 2020.4, so it is
reasonable to assume it is there in any modern Redfish
implementation.
Tested: Nabil tested and verified this worked.
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
Change-Id: I4952daf30f9b654234dd0e838adebc38cc8c380f
diff --git a/.env.ibm b/.env.ibm
index 39cc416..cbfe7bb 100644
--- a/.env.ibm
+++ b/.env.ibm
@@ -2,7 +2,6 @@
VUE_APP_ENV_NAME=ibm
VUE_APP_COMPANY_NAME="IBM"
VUE_APP_GUI_NAME="BMC System Management"
-VUE_APP_FAN_DATA_FROM_THERMAL_SUBSYSTEM="true"
CUSTOM_STYLES=true
CUSTOM_APP_NAV=true
CUSTOM_ROUTER=true
diff --git a/.env.intel b/.env.intel
index c7dea36..382e7fb 100644
--- a/.env.intel
+++ b/.env.intel
@@ -8,8 +8,7 @@
VUE_APP_VIRTUAL_MEDIA_LIST_ENABLED="true"
VUE_APP_EVENT_LOGS_DELETE_BUTTON_DISABLED="true"
VUE_APP_EVENT_LOGS_TOGGLE_BUTTON_DISABLED="true"
-VUE_APP_FAN_DATA_FROM_THERMAL_SUBSYSTEM="true"
CUSTOM_STYLES="true"
CUSTOM_APP_NAV="true"
CUSTOM_STORE="true"
-CUSTOM_ROUTER="true"
\ No newline at end of file
+CUSTOM_ROUTER="true"
diff --git a/src/store/modules/HardwareStatus/FanStore.js b/src/store/modules/HardwareStatus/FanStore.js
index 104f845..202a432 100644
--- a/src/store/modules/HardwareStatus/FanStore.js
+++ b/src/store/modules/HardwareStatus/FanStore.js
@@ -11,49 +11,24 @@
mutations: {
setFanInfo: (state, data) => {
state.fans = data.map((fan) => {
- const ThermalSubsystem =
- process.env.VUE_APP_FAN_DATA_FROM_THERMAL_SUBSYSTEM === 'true'
- ? true
- : false;
- if (ThermalSubsystem) {
- const {
- Id,
- Name,
- PartNumber,
- SerialNumber,
- SpeedPercent = {},
- Status = {},
- } = fan;
- return {
- id: Id,
- health: Status.Health,
- name: Name,
- speed: SpeedPercent.Reading,
- statusState: Status.State,
- healthRollup: Status.HealthRollup,
- partNumber: PartNumber,
- serialNumber: SerialNumber,
- };
- } else {
- const {
- MemberId,
- Name,
- Reading,
- Status = {},
- PartNumber,
- SerialNumber,
- } = fan;
- return {
- id: MemberId,
- health: Status.Health,
- partNumber: PartNumber,
- serialNumber: SerialNumber,
- healthRollup: Status.HealthRollup,
- name: Name,
- speed: Reading,
- statusState: Status.State,
- };
- }
+ const {
+ Id,
+ Name,
+ PartNumber,
+ SerialNumber,
+ SpeedPercent = {},
+ Status = {},
+ } = fan;
+ return {
+ id: Id,
+ health: Status.Health,
+ name: Name,
+ speed: SpeedPercent.Reading,
+ statusState: Status.State,
+ healthRollup: Status.HealthRollup,
+ partNumber: PartNumber,
+ serialNumber: SerialNumber,
+ };
});
},
},
@@ -79,35 +54,22 @@
.catch((error) => console.log(error));
},
async getChassisFans(_, chassis) {
- const ThermalSubsystem =
- process.env.VUE_APP_FAN_DATA_FROM_THERMAL_SUBSYSTEM === 'true'
- ? true
- : false;
- if (ThermalSubsystem) {
- return await api
- .get(chassis.ThermalSubsystem['@odata.id'])
- .then((response) => {
- return api.get(`${response.data.Fans['@odata.id']}`);
- })
- .then(({ data: { Members } }) => {
- const promises = Members.map((member) =>
- api.get(member['@odata.id']),
- );
- return api.all(promises);
- })
- .then((response) => {
- const data = response.map(({ data }) => data);
- return data;
- })
- .catch((error) => console.log(error));
- } else {
- return await api
- .get(chassis.Thermal['@odata.id'])
- .then(({ data: { Fans } }) => {
- return Fans || [];
- })
- .catch((error) => console.log(error));
- }
+ return await api
+ .get(chassis.ThermalSubsystem['@odata.id'])
+ .then((response) => {
+ return api.get(`${response.data.Fans['@odata.id']}`);
+ })
+ .then(({ data: { Members } }) => {
+ const promises = Members.map((member) =>
+ api.get(member['@odata.id']),
+ );
+ return api.all(promises);
+ })
+ .then((response) => {
+ const data = response.map(({ data }) => data);
+ return data;
+ })
+ .catch((error) => console.log(error));
},
},
};