Create OCC objects on app startup

Previously OCC objects would be created either in response (D-Bus
signals) to CPU inventory objects being created, or if the CPU objects
were already present when the openpower-occ-control app starts. We've
had few issues where it has seemed like the OCC objects never got
created, or did not get created in time; the CPU objects were created
though. This is suggestive of either a race, or the D-Bus signal being
missed altogether.

Simplify by creating OCC objects when the app starts (we know how many
OCC objects to create based on system specific config), instead of doing
it reactively. The OCC objects will be marked active only when we're
sent a sensor from the host asking to do so. That's not changing.

Change-Id: I782ea4f120292542e3c7b32b1e0acfa8efb5e8e6
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
diff --git a/occ_manager.cpp b/occ_manager.cpp
index 7d51490..42b6390 100644
--- a/occ_manager.cpp
+++ b/occ_manager.cpp
@@ -15,27 +15,11 @@
 
 void Manager::findAndCreateObjects()
 {
-    // Need to watch for CPU inventory creation.
     for (auto id = 0; id < MAX_CPUS; ++id)
     {
-        auto path = std::string(CPU_PATH) + std::to_string(id);
-        cpuMatches.emplace_back(
-                bus,
-                sdbusRule::interfacesAdded() +
-                sdbusRule::argNpath(0, path),
-                std::bind(std::mem_fn(&Manager::cpuCreated),
-                    this, std::placeholders::_1));
-    }
-
-    // Check if CPU inventory exists already.
-    auto occs = open_power::occ::finder::get(bus);
-    if (!occs.empty())
-    {
-        for (const auto& occ : occs)
-        {
-            // CPU inventory exists already, OCC objects can be created.
-            createObjects(occ);
-        }
+        // Create one occ per cpu
+        auto occ = std::string(OCC_NAME) + std::to_string(id);
+        createObjects(occ);
     }
 }