Update PSU if version cannot be obtained
Currently this application will ignore a PSU if the PSU code version
cannot be obtained.
However, there are several scenarios where this could occur:
* A code update was previously attempted on the PSU, and the update
failed. The PSU is now in a bad state, and the update needs to be
performed again.
* The PSU is running old code that does not support reading the code
version.
In these scenarios performing a code update on the PSU is desired.
Enhance this application so that a PSU with an unknown code version will
be updated provided that it is the correct model.
Tested:
* Verified code update was still performed if version could not be
obtained.
* Tested where PSU information is found at start of application
* Tested where PSU information is found from InterfacesAdded event
* Tested where PSU information is found from PropertiesChanged event
* For the complete test plan, see
https://gist.github.com/smccarney/3846a97fef590eb69181edc669555a00
Change-Id: I6e60761fa20eeb4500529c00f33de16d69a8d84d
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
diff --git a/src/item_updater.hpp b/src/item_updater.hpp
index e07aca8..885847a 100644
--- a/src/item_updater.hpp
+++ b/src/item_updater.hpp
@@ -163,6 +163,15 @@
*/
void removePsuObject(const std::string& psuInventoryPath);
+ /** @brief Add PSU inventory path to the PSU status map
+ * @details Also adds PropertiesChanged listeners for the inventory path so
+ * we are notified when the present or model properties change.
+ * Does nothing if the inventory path already exists in the map.
+ *
+ * @param[in] psuPath - The PSU inventory path
+ */
+ void addPsuToStatusMap(const std::string& psuPath);
+
/**
* @brief Create and populate the active PSU Version.
*/