Associate to the parent
Redfish is the consumer of the associations and they
want to know what board a sensor is on. This will help
with that.
Change-Id: I7f39fe4065a1275fc04e7c232dd7032a6be7fc8e
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/src/Utils.cpp b/src/Utils.cpp
index ac552be..079be79 100644
--- a/src/Utils.cpp
+++ b/src/Utils.cpp
@@ -213,9 +213,12 @@
{
if (association)
{
+ std::filesystem::path p(path);
+
using Association = std::tuple<std::string, std::string, std::string>;
std::vector<Association> associations;
- associations.push_back(Association("inventory", "sensors", path));
+ associations.push_back(
+ Association("inventory", "sensors", p.parent_path().string()));
association->register_property("associations", associations);
association->initialize();
}