power-utils: Implement isReadyToUpdate
Check other PSUs' status word and status vout, return false when the
status has input/output fault.
Tested: Verify on Witherspoon that the update is not started and log
Unable to update PSU when other PSU has input/ouput fault
when the other PSU has input/output error;
And the update continues when the other PSU has no errors.
Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: Ia2a4a23a43c18a417b8a85fbd5339f487984e689
diff --git a/utility.hpp b/utility.hpp
index ffc489c..0326cac 100644
--- a/utility.hpp
+++ b/utility.hpp
@@ -128,9 +128,23 @@
/**
* Check if power is on
*
- * @return true if power is on, otherwise false
+ * @param[in] bus - D-Bus object
+ * @param[in] defaultState - The default state if the function fails to get
+ * the power state.
+ *
+ * @return true if power is on, otherwise false;
+ * defaultState if it fails to get the power state.
*/
-bool isPoweredOn(sdbusplus::bus::bus& bus);
+bool isPoweredOn(sdbusplus::bus::bus& bus, bool defaultState = false);
+
+/**
+ * Get all PSU inventory paths from D-Bus
+ *
+ * @param[in] bus - D-Bus object
+ *
+ * @return The list of PSU inventory paths
+ */
+std::vector<std::string> getPSUInventoryPaths(sdbusplus::bus::bus& bus);
} // namespace util
} // namespace power