bmcweb: Remove "revert_old_sensor_patches"
We have migrated all bmcweb platforms to gbmcweb.
Tested: Presubmit will test the build
Fusion-Link: fusion2 not needed since if patches are used, it won't
build
Google-Bug-Id: 320507112
Google-Bug-Id: 287682477
Change-Id: I1c9c72ca128c69de6644a5b7fb05b01c56e55926
Signed-off-by: Brandon Kim <brandonkim@google.com>
diff --git a/recipes-phosphor/interfaces/bmcweb/DOWNSTREAM_0001-Revert-to-old-sensor-override-logic.patch b/recipes-phosphor/interfaces/bmcweb/DOWNSTREAM_0001-Revert-to-old-sensor-override-logic.patch
deleted file mode 100644
index caf4efe..0000000
--- a/recipes-phosphor/interfaces/bmcweb/DOWNSTREAM_0001-Revert-to-old-sensor-override-logic.patch
+++ /dev/null
@@ -1,154 +0,0 @@
-From 76edceb305549c3c0e35faed7a9f9333d95b08e5 Mon Sep 17 00:00:00 2001
-From: Vlad Sytchenko <vsytch@google.com>
-Date: Fri, 26 May 2023 20:57:26 +0000
-Subject: [PATCH] Revert to old sensor override logic
-
-See github.com/openbmc/bmcweb/issues/253 for technical details.
-
-This reverts the following commits:
-* 3e35c761b7793696267870550bd6f0b0035f4110
-* c71d61258bd3cd8573166011b450a1eecce2c572
-
-Google-Bug-Id: 277958097
-Google-Bug-Id: 283748401
-Signed-off-by: Vlad Sytchenko <vsytch@google.com>
-
-Patch Tracking Bug: b/287682477
-Upstream info / review: N/A
-Upstream-Status: Inappropriate [bugfix(b/267692430)]
-Justification: This is a stop gap solution to have the sensor override
-subsystem in bmcweb be compatible with today's version of Meltan.
----
- redfish-core/lib/sensors.hpp | 49 +++++++++++++-----------------------
- 1 file changed, 18 insertions(+), 31 deletions(-)
-
-diff --git a/redfish-core/lib/sensors.hpp b/redfish-core/lib/sensors.hpp
-index 0f673b4f..56b36748 100644
---- a/redfish-core/lib/sensors.hpp
-+++ b/redfish-core/lib/sensors.hpp
-@@ -763,6 +763,7 @@ inline void objectPropertiesToJson(
- // Set MemberId and Name for non-power sensors. For PowerSupplies and
- // PowerControl, those properties have more general values because
- // multiple sensors can be stored in the same JSON object.
-+ sensorJson["MemberId"] = sensorName;
- std::string sensorNameEs(sensorName);
- std::replace(sensorNameEs.begin(), sensorNameEs.end(), '_', ' ');
- sensorJson["Name"] = std::move(sensorNameEs);
-@@ -1112,7 +1113,7 @@ inline void populateFanRedundancy(
- auto schemaItem =
- std::find_if(fanRedfish.begin(), fanRedfish.end(),
- [itemName](const nlohmann::json& fan) {
-- return fan["Name"] == itemName;
-+ return fan["MemberId"] == itemName;
- });
- if (schemaItem != fanRedfish.end())
- {
-@@ -1147,6 +1148,7 @@ inline void populateFanRedundancy(
- redundancy["@odata.id"] = std::move(url);
- redundancy["@odata.type"] = "#Redundancy.v1_3_2.Redundancy";
- redundancy["MinNumNeeded"] = minNumNeeded;
-+ redundancy["MemberId"] = name;
- redundancy["Mode"] = "N+m";
- redundancy["Name"] = name;
- redundancy["RedundancySet"] = redfishCollection;
-@@ -1192,7 +1194,6 @@ inline void
- if (value != nullptr)
- {
- *value += "/" + std::to_string(count);
-- sensorJson["MemberId"] = std::to_string(count);
- count++;
- sensorsAsyncResp->updateUri(sensorJson["Name"], *value);
- }
-@@ -2223,7 +2224,7 @@ inline nlohmann::json& getPowerSupply(nlohmann::json& powerSupplyArray,
- // Check if matching PowerSupply object already exists in JSON array
- for (nlohmann::json& powerSupply : powerSupplyArray)
- {
-- if (powerSupply["Name"] == inventoryItem.name)
-+ if (powerSupply["MemberId"] == inventoryItem.name)
- {
- return powerSupply;
- }
-@@ -2236,6 +2237,7 @@ inline nlohmann::json& getPowerSupply(nlohmann::json& powerSupplyArray,
- "redfish", "v1", "Chassis", chassisId, "Power");
- url.set_fragment(("/PowerSupplies"_json_pointer).to_string());
- powerSupply["@odata.id"] = std::move(url);
-+ powerSupply["MemberId"] = inventoryItem.name;
- powerSupply["Name"] = boost::replace_all_copy(inventoryItem.name, "_", " ");
- powerSupply["Manufacturer"] = inventoryItem.manufacturer;
- powerSupply["Model"] = inventoryItem.model;
-@@ -2602,24 +2604,6 @@ inline bool
- return false;
- }
-
--inline std::pair<std::string, std::string>
-- splitSensorNameAndType(std::string_view sensorId)
--{
-- size_t index = sensorId.find('_');
-- if (index == std::string::npos)
-- {
-- return std::make_pair<std::string, std::string>("", "");
-- }
-- std::string sensorType{sensorId.substr(0, index)};
-- std::string sensorName{sensorId.substr(index + 1)};
-- // fan_pwm and fan_tach need special handling
-- if (sensorType == "fantach" || sensorType == "fanpwm")
-- {
-- sensorType.insert(3, 1, '_');
-- }
-- return std::make_pair(sensorType, sensorName);
--}
--
- /**
- * @brief Entry point for overriding sensor values of given sensor
- *
-@@ -2676,10 +2660,8 @@ inline void setSensorsOverride(
- for (const auto& item : overrideMap)
- {
- const auto& sensor = item.first;
-- std::pair<std::string, std::string> sensorNameType =
-- splitSensorNameAndType(sensor);
-- if (!findSensorNameUsingSensorPath(sensorNameType.second,
-- *sensorsList, *sensorNames))
-+ if (!findSensorNameUsingSensorPath(sensor, *sensorsList,
-+ *sensorNames))
- {
- BMCWEB_LOG_INFO << "Unable to find memberId " << item.first;
- messages::resourceNotFound(sensorAsyncResp->asyncResp->res,
-@@ -2990,23 +2972,28 @@ inline void handleSensorGet(App& app, const crow::Request& req,
- {
- return;
- }
-- std::pair<std::string, std::string> nameType =
-- splitSensorNameAndType(sensorId);
-- if (nameType.first.empty() || nameType.second.empty())
-+ size_t index = sensorId.find('_');
-+ if (index == std::string::npos)
- {
- messages::resourceNotFound(asyncResp->res, sensorId, "Sensor");
- return;
- }
--
- asyncResp->res.jsonValue["@odata.id"] = crow::utility::urlFromPieces(
- "redfish", "v1", "Chassis", chassisId, "Sensors", sensorId);
-+ std::string sensorType = sensorId.substr(0, index);
-+ std::string sensorName = sensorId.substr(index + 1);
-+ // fan_pwm and fan_tach need special handling
-+ if (sensorType == "fantach" || sensorType == "fanpwm")
-+ {
-+ sensorType.insert(3, 1, '_');
-+ }
-
- BMCWEB_LOG_DEBUG << "Sensor doGet enter";
-
- constexpr std::array<std::string_view, 1> interfaces = {
- "xyz.openbmc_project.Sensor.Value"};
-- std::string sensorPath = "/xyz/openbmc_project/sensors/" + nameType.first +
-- '/' + nameType.second;
-+ std::string sensorPath =
-+ "/xyz/openbmc_project/sensors/" + sensorType + '/' + sensorName;
- // Get a list of all of the sensors that implement Sensor.Value
- // and get the path and service name associated with the sensor
- ::dbus::utility::getDbusObject(
---
-2.41.0.487.g6d72f3e995-goog
-
diff --git a/recipes-phosphor/interfaces/bmcweb_%.bbappend b/recipes-phosphor/interfaces/bmcweb_%.bbappend
index 43e185a..f4227cb 100644
--- a/recipes-phosphor/interfaces/bmcweb_%.bbappend
+++ b/recipes-phosphor/interfaces/bmcweb_%.bbappend
@@ -102,13 +102,6 @@
"
# Agentless feature ends
-# Bugfix(b/277958097)
-revert_old_sensor_patches = " \
- file://DOWNSTREAM_0001-Revert-to-old-sensor-override-logic.patch \
-"
-revert_old_sensor_patches:gbmcfork = ""
-SRC_URI:append:gbmc = "${revert_old_sensor_patches}"
-
# Override the Source Revision for non-gbmcweb platforms.
SRCREV:kudo = "6c3e94511027133db407f9e1c3c628927ec1332f"