functions: change EM's ObjectManager path

EntityManager moves its ObjectManager in commit [1], this patch is to
change accordingly. Please see [1] for why we made that change.

[1] https://gerrit.openbmc.org/c/openbmc/entity-manager/+/57279

Tested: code compiles. I don't know how to test this project. But code
inspection can show that only ObjectManager path changed.

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: Iff4c5cc58daa29c8f1caa2c3faff0241d47c8b9a
diff --git a/functions.cpp b/functions.cpp
index c06108f..ab97e0a 100644
--- a/functions.cpp
+++ b/functions.cpp
@@ -41,9 +41,11 @@
  * @brief Returns the managed objects for a given service
  */
 ManagedObjectType getManagedObjects(sdbusplus::bus_t& bus,
-                                    const std::string& service)
+                                    const std::string& service,
+                                    const std::string& managerPath)
+
 {
-    auto method = bus.new_method_call(service.c_str(), "/",
+    auto method = bus.new_method_call(service.c_str(), managerPath.c_str(),
                                       "org.freedesktop.DBus.ObjectManager",
                                       "GetManagedObjects");
 
@@ -663,7 +665,7 @@
     // xyz.openbmc_project.Configuration.IBMCompatibleSystem), activate entity
     // manager if it isn't running and enumerate its objects
     auto getManagedObjects = bus.new_method_call(
-        "xyz.openbmc_project.EntityManager", "/",
+        "xyz.openbmc_project.EntityManager", "/xyz/openbmc_project/inventory",
         "org.freedesktop.DBus.ObjectManager", "GetManagedObjects");
     std::map<std::string,
              std::map<std::string, std::variant<std::vector<std::string>>>>
@@ -783,7 +785,8 @@
 
             auto bus = sdbusplus::bus::new_default();
             InterfacesPropertiesMap interfacesAndProperties;
-            auto objects = getManagedObjects(bus, entityManagerServiceName);
+            auto objects = getManagedObjects(bus, entityManagerServiceName,
+                                             "/xyz/openbmc_project/inventory");
             for (const auto& pair : objects)
             {
                 std::tie(std::ignore, interfacesAndProperties) = pair;
@@ -796,7 +799,8 @@
         }));
 
     InterfacesPropertiesMap interfacesAndProperties;
-    auto objects = getManagedObjects(bus, entityManagerServiceName);
+    auto objects = getManagedObjects(bus, entityManagerServiceName,
+                                     "/xyz/openbmc_project/inventory");
     for (const auto& pair : objects)
     {
         std::tie(std::ignore, interfacesAndProperties) = pair;