diff options
author | Matthew Barth <msbarth@us.ibm.com> | 2018-05-10 13:18:51 -0500 |
---|---|---|
committer | Matthew Barth <msbarth@us.ibm.com> | 2018-05-17 12:13:36 -0500 |
commit | f3adb7827b1b153b2e2d12d432a67deff95ee5e3 (patch) | |
tree | f2760ef3b1c6f96223080e7f2d581b62e6ee2ba9 | |
parent | 1af90f09ea490cac195c734a1ff52546f93a5d76 (diff) | |
download | phosphor-fan-presence-f3adb7827b1b153b2e2d12d432a67deff95ee5e3.tar.gz phosphor-fan-presence-f3adb7827b1b153b2e2d12d432a67deff95ee5e3.zip |
utility: Remove getService function
The getService function is no longer used and is not necessary with the
getService function within sdbusplus.hpp
Tested: N/A
Change-Id: Ifad8ec1efb64508923d4f5c42bef318f0b03124c
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
-rw-r--r-- | utility.cpp | 46 | ||||
-rw-r--r-- | utility.hpp | 14 |
2 files changed, 1 insertions, 59 deletions
diff --git a/utility.cpp b/utility.cpp index 1bb979e..08970d3 100644 --- a/utility.cpp +++ b/utility.cpp @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include <string> #include "utility.hpp" namespace phosphor @@ -22,50 +21,7 @@ namespace fan { namespace util { - -using namespace std::string_literals; - -using namespace phosphor::logging; -using InternalFailure = sdbusplus::xyz::openbmc_project::Common:: - Error::InternalFailure; - -std::string getService(const std::string& path, - const std::string& interface, - sdbusplus::bus::bus& bus) -{ - auto mapperCall = bus.new_method_call(MAPPER_BUSNAME, - MAPPER_PATH, - MAPPER_INTERFACE, - "GetObject"); - - mapperCall.append(path); - mapperCall.append(std::vector<std::string>({interface})); - - auto mapperResponseMsg = bus.call(mapperCall); - if (mapperResponseMsg.is_method_error()) - { - log<level::ERR>("Error in mapper call to get service name", - entry("PATH=%s", path.c_str()), - entry("INTERFACE=%s", interface.c_str())); - elog<InternalFailure>(); - } - - - std::map<std::string, std::vector<std::string>> mapperResponse; - mapperResponseMsg.read(mapperResponse); - - if (mapperResponse.empty()) - { - log<level::ERR>( - "Error in mapper response for getting service name", - entry("PATH=%s", path.c_str()), - entry("INTERFACE=%s", interface.c_str())); - elog<InternalFailure>(); - } - - return mapperResponse.begin()->first; -} - + // Keep for future functions } } } diff --git a/utility.hpp b/utility.hpp index fbae129..f97b505 100644 --- a/utility.hpp +++ b/utility.hpp @@ -80,20 +80,6 @@ class FileDescriptor }; /** - * @brief Get the service name from the mapper for the - * interface and path passed in. - * - * @param[in] path - the dbus path name - * @param[in] interface - the dbus interface name - * @param[in] bus - the dbus object - * - * @return The service name - */ -std::string getService(const std::string& path, - const std::string& interface, - sdbusplus::bus::bus& bus); - -/** * @brief Get the object map for creating or updating an object property * * @param[in] path - The dbus object path name |