Correct missed application of getOtherSensorsCount function
There was still a hard coded calculation of the number of SDR's.
Removed the hard coded calculation and replaced it with the weak
linked getOtherSensorsCount() function.
Tested:
Not tested.
Change-Id: I8f46ec498b044c095e0da8fd626c1dea945e5705
Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
diff --git a/dbus-sdr/sensorcommands.cpp b/dbus-sdr/sensorcommands.cpp
index 1fbd5cf..72cf377 100644
--- a/dbus-sdr/sensorcommands.cpp
+++ b/dbus-sdr/sensorcommands.cpp
@@ -2436,22 +2436,9 @@
>
ipmiStorageGetSDRRepositoryInfo(ipmi::Context::ptr ctx)
{
- auto& sensorTree = getSensorTree();
constexpr const uint16_t unspecifiedFreeSpace = 0xFFFF;
- if (!getSensorSubtree(sensorTree) && sensorTree.empty())
- {
- return ipmi::responseResponseError();
- }
-
- size_t fruCount = 0;
- ipmi::Cc ret = ipmi::storage::getFruSdrCount(ctx, fruCount);
- if (ret != ipmi::ccSuccess)
- {
- return ipmi::response(ret);
- }
-
- uint16_t recordCount = ipmi::getNumberOfSensors() + fruCount +
- ipmi::storage::type12Count;
+ uint16_t recordCount = ipmi::getNumberOfSensors() +
+ ipmi::sensor::getOtherSensorsCount(ctx);
uint8_t operationSupport = static_cast<uint8_t>(
SdrRepositoryInfoOps::overflow); // write not supported