Update DBus initialization and use
The DBus instance variable is no longer a passed parameter to instance
methods. Instance methods can access the private DBus variable directly.
Change-Id: Id0c988802e5ad6c2757e7a243ee92331f447ac0d
Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
diff --git a/user_channel/channel_mgmt.cpp b/user_channel/channel_mgmt.cpp
index 20e58b0..697219c 100644
--- a/user_channel/channel_mgmt.cpp
+++ b/user_channel/channel_mgmt.cpp
@@ -605,8 +605,8 @@
"/" + channelData[chNum].chName;
try
{
- if (0 != setDbusProperty(bus, networkIntfServiceName,
- networkIntfObj, networkChConfigIntfName,
+ if (0 != setDbusProperty(networkIntfServiceName, networkIntfObj,
+ networkChConfigIntfName,
privilegePropertyString, privStr))
{
log<level::DEBUG>(
@@ -972,7 +972,6 @@
log<level::DEBUG>("Error in opening IPMI Channel data file");
return -EIO;
}
-
try
{
// Fill in global structure
@@ -1041,7 +1040,6 @@
log<level::DEBUG>("Error in opening IPMI Channel data file");
return -EIO;
}
-
try
{
// Fill in global structure
@@ -1238,8 +1236,7 @@
return ret;
}
-int ChannelConfig::setDbusProperty(sdbusplus::bus::bus& bus,
- const std::string& service,
+int ChannelConfig::setDbusProperty(const std::string& service,
const std::string& objPath,
const std::string& interface,
const std::string& property,
@@ -1268,8 +1265,7 @@
return 0;
}
-int ChannelConfig::getDbusProperty(sdbusplus::bus::bus& bus,
- const std::string& service,
+int ChannelConfig::getDbusProperty(const std::string& service,
const std::string& objPath,
const std::string& interface,
const std::string& property,
@@ -1314,8 +1310,7 @@
std::string(networkIntfObjectBasePath) + "/" +
channelData[chNum].chName;
DbusVariant variant;
- if (0 != getDbusProperty(bus, networkIntfServiceName,
- networkIntfObj,
+ if (0 != getDbusProperty(networkIntfServiceName, networkIntfObj,
networkChConfigIntfName,
privilegePropertyString, variant))
{
diff --git a/user_channel/channel_mgmt.hpp b/user_channel/channel_mgmt.hpp
index 02f951b..8b81391 100644
--- a/user_channel/channel_mgmt.hpp
+++ b/user_channel/channel_mgmt.hpp
@@ -308,7 +308,6 @@
/** @brief function to set D-Bus property value
*
- * @param[in] bus - bus
* @param[in] service - service name
* @param[in] objPath - object path
* @param[in] interface - interface
@@ -317,14 +316,12 @@
*
* @return 0 for success, -errno for failure.
*/
- int setDbusProperty(sdbusplus::bus::bus& bus, const std::string& service,
- const std::string& objPath,
+ int setDbusProperty(const std::string& service, const std::string& objPath,
const std::string& interface,
const std::string& property, const DbusVariant& value);
/** @brief function to get D-Bus property value
*
- * @param[in] bus - bus
* @param[in] service - service name
* @param[in] objPath - object path
* @param[in] interface - interface
@@ -333,8 +330,7 @@
*
* @return 0 for success, -errno for failure.
*/
- int getDbusProperty(sdbusplus::bus::bus& bus, const std::string& service,
- const std::string& objPath,
+ int getDbusProperty(const std::string& service, const std::string& objPath,
const std::string& interface,
const std::string& property, DbusVariant& value);