Fix to populate all HSBP inventory
Issue: if backplanes map cleared inside of the async_method_call,
system is not populating all HSBP inventory items in RedFish.
Fix: So moved backplanes.clear() to outside of the async_method_call.
Now RedFish populating all the HSBP inventory items.
Tested:
Verified from Redfish, shown both HSBP inventory items.
Signed-off-by: Jayaprakash Mutyala <mutyalax.jayaprakash@intel.com>
Change-Id: Idd8ca45b19e7d124a9cfbbe9bbbfb698fc289a6f
diff --git a/hsbp-manager/src/hsbp_manager.cpp b/hsbp-manager/src/hsbp_manager.cpp
index 39d093c..ad1aea2 100644
--- a/hsbp-manager/src/hsbp_manager.cpp
+++ b/hsbp-manager/src/hsbp_manager.cpp
@@ -979,6 +979,7 @@
void populate()
{
+ backplanes.clear();
conn->async_method_call(
[](const boost::system::error_code ec, const GetSubTreeType& subtree) {
if (ec)
@@ -1004,7 +1005,6 @@
<< ec2.message() << "\n";
return;
}
- backplanes.clear();
std::optional<size_t> bus;
std::optional<size_t> address;
std::optional<size_t> backplaneIndex;