Rename getPSUInventoryPath to getPSUInventoryPaths
Rename the utils method/function getPSUInventoryPath() to
getPSUInventoryPaths(). The method/function returns multiple paths in a
vector, so the name should be plural. This will make the return type
more clear. Currently the name implies only one path will be returned.
Tested:
* Verified all automated tests build and run successfully
* Verified getPSUInventoryPaths() returns correct data
Change-Id: I7e215c37e3ce1eb27313bc51348c7f7335c8f67a
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
diff --git a/src/activation.cpp b/src/activation.cpp
index ed985a1..c52e1b6 100644
--- a/src/activation.cpp
+++ b/src/activation.cpp
@@ -155,7 +155,7 @@
return activation(); // Return the previous activation status
}
- auto psuPaths = utils::getPSUInventoryPath(bus);
+ auto psuPaths = utils::getPSUInventoryPaths(bus);
if (psuPaths.empty())
{
lg2::warning("No PSU inventory found");
diff --git a/src/item_updater.cpp b/src/item_updater.cpp
index aea02ee..2760245 100644
--- a/src/item_updater.cpp
+++ b/src/item_updater.cpp
@@ -394,7 +394,7 @@
{
try
{
- auto paths = utils::getPSUInventoryPath(bus);
+ auto paths = utils::getPSUInventoryPaths(bus);
for (const auto& p : paths)
{
try
@@ -558,7 +558,7 @@
const auto& activation = it->second;
const auto& assocs = activation->associations();
- auto paths = utils::getPSUInventoryPath(bus);
+ auto paths = utils::getPSUInventoryPaths(bus);
for (const auto& p : paths)
{
// If there is a present PSU that is not associated with the latest
diff --git a/src/utils.cpp b/src/utils.cpp
index 6b7f602..abea750 100644
--- a/src/utils.cpp
+++ b/src/utils.cpp
@@ -59,7 +59,8 @@
return utils;
}
-std::vector<std::string> Utils::getPSUInventoryPath(sdbusplus::bus_t& bus) const
+std::vector<std::string>
+ Utils::getPSUInventoryPaths(sdbusplus::bus_t& bus) const
{
std::vector<std::string> paths;
try
diff --git a/src/utils.hpp b/src/utils.hpp
index 3b033fc..020d528 100644
--- a/src/utils.hpp
+++ b/src/utils.hpp
@@ -26,7 +26,7 @@
/**
* @brief Get PSU inventory object path from DBus
*/
-std::vector<std::string> getPSUInventoryPath(sdbusplus::bus_t& bus);
+std::vector<std::string> getPSUInventoryPaths(sdbusplus::bus_t& bus);
/** @brief Get service name from object path and interface
*
@@ -128,7 +128,7 @@
virtual ~UtilsInterface() = default;
virtual std::vector<std::string>
- getPSUInventoryPath(sdbusplus::bus_t& bus) const = 0;
+ getPSUInventoryPaths(sdbusplus::bus_t& bus) const = 0;
virtual std::string getService(sdbusplus::bus_t& bus, const char* path,
const char* interface) const = 0;
@@ -168,7 +168,7 @@
{
public:
std::vector<std::string>
- getPSUInventoryPath(sdbusplus::bus_t& bus) const override;
+ getPSUInventoryPaths(sdbusplus::bus_t& bus) const override;
std::string getService(sdbusplus::bus_t& bus, const char* path,
const char* interface) const override;
@@ -206,9 +206,9 @@
return getUtils().getServices(bus, path, interface);
}
-inline std::vector<std::string> getPSUInventoryPath(sdbusplus::bus_t& bus)
+inline std::vector<std::string> getPSUInventoryPaths(sdbusplus::bus_t& bus)
{
- return getUtils().getPSUInventoryPath(bus);
+ return getUtils().getPSUInventoryPaths(bus);
}
inline std::string getVersionId(const std::string& version)