diff options
Diffstat (limited to 'redfish-core/lib/chassis.hpp')
-rw-r--r-- | redfish-core/lib/chassis.hpp | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/redfish-core/lib/chassis.hpp b/redfish-core/lib/chassis.hpp index 9ee10b5c62..19728a470e 100644 --- a/redfish-core/lib/chassis.hpp +++ b/redfish-core/lib/chassis.hpp @@ -402,23 +402,28 @@ inline void handleDecoratorAssetProperties( asyncResp->res.jsonValue["Name"] = chassisId; asyncResp->res.jsonValue["Id"] = chassisId; -#ifdef BMCWEB_ALLOW_DEPRECATED_POWER_THERMAL - asyncResp->res.jsonValue["Thermal"]["@odata.id"] = - boost::urls::format("/redfish/v1/Chassis/{}/Thermal", chassisId); - // Power object - asyncResp->res.jsonValue["Power"]["@odata.id"] = - boost::urls::format("/redfish/v1/Chassis/{}/Power", chassisId); -#endif -#ifdef BMCWEB_NEW_POWERSUBSYSTEM_THERMALSUBSYSTEM - asyncResp->res.jsonValue["ThermalSubsystem"]["@odata.id"] = - boost::urls::format("/redfish/v1/Chassis/{}/ThermalSubsystem", - chassisId); - asyncResp->res.jsonValue["PowerSubsystem"]["@odata.id"] = - boost::urls::format("/redfish/v1/Chassis/{}/PowerSubsystem", chassisId); - asyncResp->res.jsonValue["EnvironmentMetrics"]["@odata.id"] = - boost::urls::format("/redfish/v1/Chassis/{}/EnvironmentMetrics", - chassisId); -#endif + + if constexpr (BMCWEB_REDFISH_ALLOW_DEPRECATED_POWER_THERMAL) + { + asyncResp->res.jsonValue["Thermal"]["@odata.id"] = + boost::urls::format("/redfish/v1/Chassis/{}/Thermal", chassisId); + // Power object + asyncResp->res.jsonValue["Power"]["@odata.id"] = + boost::urls::format("/redfish/v1/Chassis/{}/Power", chassisId); + } + + if constexpr (BMCWEB_REDFISH_NEW_POWERSUBSYSTEM_THERMALSUBSYSTEM) + { + asyncResp->res.jsonValue["ThermalSubsystem"]["@odata.id"] = + boost::urls::format("/redfish/v1/Chassis/{}/ThermalSubsystem", + chassisId); + asyncResp->res.jsonValue["PowerSubsystem"]["@odata.id"] = + boost::urls::format("/redfish/v1/Chassis/{}/PowerSubsystem", + chassisId); + asyncResp->res.jsonValue["EnvironmentMetrics"]["@odata.id"] = + boost::urls::format("/redfish/v1/Chassis/{}/EnvironmentMetrics", + chassisId); + } // SensorCollection asyncResp->res.jsonValue["Sensors"]["@odata.id"] = boost::urls::format("/redfish/v1/Chassis/{}/Sensors", chassisId); |