Ensure occActive called after device enabled

I noticed that the power cap bounds was not getting updated. This
was caused because the device.master() call was made before setting the
occActive flag.

The device object now prevents the device from triggering sysfs reads
if the occActive flag is not set.
This change will set occActive right after enabling the device.

Also prevent extra calls to checkAllActiveSensors by only setting the
waitingForAll flag once.

Change-Id: If19771e53b64dd1d5e27e7ae153bd56e0e070aff
Signed-off-by: Chris Cain <cjcain@us.ibm.com>
diff --git a/occ_manager.cpp b/occ_manager.cpp
index 34a815a..0e6fb8d 100644
--- a/occ_manager.cpp
+++ b/occ_manager.cpp
@@ -113,10 +113,11 @@
                     createObjects(std::string(OCC_NAME) + std::to_string(id));
                 }
                 statusObjCreated = true;
+                waitingForAllOccActiveSensors = true;
             }
         }
 
-        if (statusObjCreated)
+        if (statusObjCreated && waitingForAllOccActiveSensors)
         {
             static bool tracedHostWait = false;
             if (utils::isHostRunning())
@@ -127,7 +128,6 @@
                         "Manager::findAndCreateObjects(): Host is running");
                     tracedHostWait = false;
                 }
-                waitingForAllOccActiveSensors = true;
                 checkAllActiveSensors();
             }
             else
@@ -398,7 +398,10 @@
 #ifdef POWER10
     if (waitingForAllOccActiveSensors)
     {
-        checkAllActiveSensors();
+        if (utils::isHostRunning())
+        {
+            checkAllActiveSensors();
+        }
     }
 #endif
 }