sdbusplus: use shorter type aliases
The sdbusplus headers provide shortened aliases for many types.
Switch to using them to provide better code clarity and shorter
lines. Possible replacements are for:
* bus_t
* exception_t
* manager_t
* match_t
* message_t
* object_t
* slot_t
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ibd2a0b512bfb7caf65bfab64b271d194da520aac
diff --git a/user_channel/user_mgmt.cpp b/user_channel/user_mgmt.cpp
index a30c99a..f516d83 100644
--- a/user_channel/user_mgmt.cpp
+++ b/user_channel/user_mgmt.cpp
@@ -128,7 +128,7 @@
__attribute__((init_priority(101)));
// TODO: Below code can be removed once it is moved to common layer libmiscutil
-std::string getUserService(sdbusplus::bus::bus& bus, const std::string& intf,
+std::string getUserService(sdbusplus::bus_t& bus, const std::string& intf,
const std::string& path)
{
auto mapperCall = bus.new_method_call(objMapperService, objMapperPath,
@@ -151,7 +151,7 @@
return mapperResponse.begin()->first;
}
-void setDbusProperty(sdbusplus::bus::bus& bus, const std::string& service,
+void setDbusProperty(sdbusplus::bus_t& bus, const std::string& service,
const std::string& objPath, const std::string& interface,
const std::string& property,
const DbusUserPropVariant& value)
@@ -164,7 +164,7 @@
method.append(interface, property, value);
bus.call(method);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
log<level::ERR>("Failed to set property",
entry("PROPERTY=%s", property.c_str()),
@@ -176,7 +176,7 @@
static std::string getUserServiceName()
{
- static sdbusplus::bus::bus bus(ipmid_get_sd_bus_connection());
+ static sdbusplus::bus_t bus(ipmid_get_sd_bus_connection());
static std::string userMgmtService;
if (userMgmtService.empty())
{
@@ -185,7 +185,7 @@
userMgmtService =
ipmi::getUserService(bus, userMgrInterface, userMgrObjBasePath);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
userMgmtService.clear();
}
@@ -302,10 +302,9 @@
return;
}
-void userUpdatedSignalHandler(UserAccess& usrAccess,
- sdbusplus::message::message& msg)
+void userUpdatedSignalHandler(UserAccess& usrAccess, sdbusplus::message_t& msg)
{
- static sdbusplus::bus::bus bus(ipmid_get_sd_bus_connection());
+ static sdbusplus::bus_t bus(ipmid_get_sd_bus_connection());
std::string signal = msg.get_member();
std::string userName, priv, newUserName;
std::vector<std::string> groups;
@@ -410,7 +409,7 @@
auto reply = bus.call(method);
reply.read(properties);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
log<level::DEBUG>(
"Failed to excute method",
@@ -584,7 +583,7 @@
auto reply = bus.call(method);
reply.read(properties);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
log<level::ERR>("Failed to excute method",
entry("METHOD=%s", getSubTreeMethod),
@@ -1038,7 +1037,7 @@
deleteUserInterface, deleteUserMethod);
auto reply = bus.call(method);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
log<level::DEBUG>("Failed to excute method",
entry("METHOD=%s", deleteUserMethod),
@@ -1062,7 +1061,7 @@
method.append(userName.c_str(), availableGroups, "", false);
auto reply = bus.call(method);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
log<level::DEBUG>("Failed to excute method",
entry("METHOD=%s", createUserMethod),
@@ -1086,7 +1085,7 @@
method.append(oldUser.c_str(), userName.c_str());
auto reply = bus.call(method);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
log<level::DEBUG>("Failed to excute method",
entry("METHOD=%s", renameUserMethod),
@@ -1537,7 +1536,7 @@
auto reply = bus.call(method);
reply.read(properties);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
log<level::DEBUG>("Failed to excute method",
entry("METHOD=%s", getAllPropertiesMethod),
@@ -1656,7 +1655,7 @@
sdbusplus::bus::match::rules::type::signal() +
sdbusplus::bus::match::rules::interface(dBusObjManager) +
sdbusplus::bus::match::rules::path(userMgrObjBasePath),
- [&](sdbusplus::message::message& msg) {
+ [&](sdbusplus::message_t& msg) {
userUpdatedSignalHandler(*this, msg);
});
userMgrRenamedSignal = std::make_unique<sdbusplus::bus::match_t>(
@@ -1664,7 +1663,7 @@
sdbusplus::bus::match::rules::type::signal() +
sdbusplus::bus::match::rules::interface(userMgrInterface) +
sdbusplus::bus::match::rules::path(userMgrObjBasePath),
- [&](sdbusplus::message::message& msg) {
+ [&](sdbusplus::message_t& msg) {
userUpdatedSignalHandler(*this, msg);
});
userPropertiesSignal = std::make_unique<sdbusplus::bus::match_t>(
@@ -1675,7 +1674,7 @@
dBusPropertiesInterface) +
sdbusplus::bus::match::rules::member(propertiesChangedSignal) +
sdbusplus::bus::match::rules::argN(0, usersInterface),
- [&](sdbusplus::message::message& msg) {
+ [&](sdbusplus::message_t& msg) {
userUpdatedSignalHandler(*this, msg);
});
signalHndlrObject = true;
@@ -1689,7 +1688,7 @@
auto reply = bus.call(method);
reply.read(managedObjs);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
log<level::DEBUG>("Failed to excute method",
entry("METHOD=%s", getSubTreeMethod),