Systems: Restore old-style LocationIndicatorActive
The commit 2eaa927 [1] altered the D-Bus associations used for setting
and getting the LED state for the Systems resource. Machines which use
entity-manager do not have the new association yet.
This commit is adding back the use of the old D-Bus method under a
compile option. This will be enabled by default until October 15, 2025
and completely removed by June 2026.
[1] https://gerrit.openbmc.org/c/openbmc/bmcweb/+/82078
Tested:
- Built with option enabled and confirmed logging showed old method
being used.
- Built with option disabled and confirmed logging showed new method
being used.
Change-Id: I271fc464ef512b742a8c85419668aa09d38e525d
Signed-off-by: Janet Adkins <janeta@us.ibm.com>
diff --git a/redfish-core/lib/systems.hpp b/redfish-core/lib/systems.hpp
index 7057533..a336988 100644
--- a/redfish-core/lib/systems.hpp
+++ b/redfish-core/lib/systems.hpp
@@ -3132,15 +3132,22 @@
nlohmann::json::array_t({"KVMIP"});
}
- systems_utils::getValidSystemsPath(
- asyncResp, systemName,
- [asyncResp,
- systemName](const std::optional<std::string>& validSystemsPath) {
- if (validSystemsPath)
- {
- getLocationIndicatorActive(asyncResp, *validSystemsPath);
- }
- });
+ if constexpr (BMCWEB_REDFISH_USE_HARDCODED_SYSTEM_LOCATION_INDICATOR)
+ {
+ getSystemLocationIndicatorActive(asyncResp);
+ }
+ else
+ {
+ systems_utils::getValidSystemsPath(
+ asyncResp, systemName,
+ [asyncResp,
+ systemName](const std::optional<std::string>& validSystemsPath) {
+ if (validSystemsPath)
+ {
+ getLocationIndicatorActive(asyncResp, *validSystemsPath);
+ }
+ });
+ }
if constexpr (BMCWEB_REDFISH_ALLOW_DEPRECATED_INDICATORLED)
{
@@ -3313,20 +3320,28 @@
if (patchParams.locationIndicatorActive)
{
- systems_utils::getValidSystemsPath(
- asyncResp, systemName,
- [asyncResp, systemName,
- locationIndicatorActive{*patchParams.locationIndicatorActive}](
- const std::optional<std::string>& validSystemsPath) {
- if (!validSystemsPath)
- {
- messages::resourceNotFound(asyncResp->res, "Systems",
- systemName);
- return;
- }
- setLocationIndicatorActive(asyncResp, *validSystemsPath,
- locationIndicatorActive);
- });
+ if constexpr (BMCWEB_REDFISH_USE_HARDCODED_SYSTEM_LOCATION_INDICATOR)
+ {
+ setSystemLocationIndicatorActive(
+ asyncResp, *patchParams.locationIndicatorActive);
+ }
+ else
+ {
+ systems_utils::getValidSystemsPath(
+ asyncResp, systemName,
+ [asyncResp, systemName,
+ locationIndicatorActive{*patchParams.locationIndicatorActive}](
+ const std::optional<std::string>& validSystemsPath) {
+ if (!validSystemsPath)
+ {
+ messages::resourceNotFound(asyncResp->res, "Systems",
+ systemName);
+ return;
+ }
+ setLocationIndicatorActive(asyncResp, *validSystemsPath,
+ locationIndicatorActive);
+ });
+ }
}
if constexpr (BMCWEB_REDFISH_ALLOW_DEPRECATED_INDICATORLED)