Get UUID from inventory subtree
Currently, the UUID is getting from the first object path that
includes "Common.UUID" interface. But the UUID can be obtained
from the MCTP/FRU...
The system UUID should be got from the object path that has the
prefix "xyz/openbmc_project/inventory". This commit updates
subtreepath parameter from "/" to "/xyz/openbmc_project/inventory"
to fix the issue.
Tested:
1. Get UUID via Redfish
/redfish/v1/Systems/system
2. Get UUID via IPMI command
$ ipmitool mc guid
The UUID obtained in steps #1 and #2 is same.
Signed-off-by: Hieu Huynh <hieuh@os.amperecomputing.com>
Change-Id: Ib22bf1ace489c0152a0f3eaa38f68ee35be7c64c
diff --git a/apphandler.cpp b/apphandler.cpp
index 2ce19e8..0919cfb 100644
--- a/apphandler.cpp
+++ b/apphandler.cpp
@@ -850,8 +850,8 @@
// Get the Inventory object implementing BMC interface
ipmi::DbusObjectInfo objectInfo{};
- boost::system::error_code ec =
- ipmi::getDbusObject(ctx, uuidInterface, objectInfo);
+ boost::system::error_code ec = ipmi::getDbusObject(
+ ctx, uuidInterface, ipmi::sensor::inventoryRoot, objectInfo);
if (ec.value())
{
lg2::error("Failed to locate System UUID object, "