Fix occ-control terminations
1. Ensure PowerMode object created before attempting to use
2. Only call setChassisAssociation after getting successful temperature
reading.
Tested on Everest hw
Change-Id: I308c072cf5ab0235086c136ba7644125de0a8c6a
Signed-off-by: Chris Cain <cjcain@us.ibm.com>
diff --git a/occ_pass_through.cpp b/occ_pass_through.cpp
index 6cf6374..ea640ef 100644
--- a/occ_pass_through.cpp
+++ b/occ_pass_through.cpp
@@ -137,6 +137,12 @@
return false;
}
+ if (!pmode)
+ {
+ log<level::ERR>("PassThrough::setMode: PowerMode is not defined!");
+ return false;
+ }
+
log<level::INFO>(
fmt::format("PassThrough::setMode() Setting Power Mode {} (data: {})",
newMode, modeData)