Consitently use dbus::utility types
This saves about 4k on the binary size
Tested: Redfish service validator passes.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I9546227a19c691b1aecb80e80307889548c0293f
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp
index 08765f2..e474f0a 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -103,9 +103,6 @@
namespace fs = std::filesystem;
-using GetManagedPropertyType =
- boost::container::flat_map<std::string, dbus::utility::DbusVariantType>;
-
inline std::string translateSeverityDbusToRedfish(const std::string& s)
{
if ((s == "xyz.openbmc_project.Logging.Entry.Level.Alert") ||
@@ -733,10 +730,8 @@
taskData->state = "Cancelled";
return task::completed;
}
- std::vector<std::pair<
- std::string, std::vector<std::pair<
- std::string, dbus::utility::DbusVariantType>>>>
- interfacesList;
+
+ dbus::utility::DBusInteracesMap interfacesList;
sdbusplus::message::object_path objPath;
@@ -865,8 +860,9 @@
std::string(boost::algorithm::to_lower_copy(dumpType));
crow::connections::systemBus->async_method_call(
- [asyncResp, dumpType](const boost::system::error_code ec,
- const std::vector<std::string>& subTreePaths) {
+ [asyncResp, dumpType](
+ const boost::system::error_code ec,
+ const dbus::utility::MapperGetSubTreePathsResponse& subTreePaths) {
if (ec)
{
BMCWEB_LOG_ERROR << "resp_handler got error " << ec;
@@ -893,10 +889,10 @@
dumpType});
}
-inline static void parseCrashdumpParameters(
- const std::vector<std::pair<std::string, dbus::utility::DbusVariantType>>&
- params,
- std::string& filename, std::string& timestamp, std::string& logfile)
+inline static void
+ parseCrashdumpParameters(const dbus::utility::DBusPropertiesMap& params,
+ std::string& filename, std::string& timestamp,
+ std::string& logfile)
{
for (auto property : params)
{
@@ -980,8 +976,10 @@
logServiceArray.size();
crow::connections::systemBus->async_method_call(
- [asyncResp](const boost::system::error_code ec,
- const std::vector<std::string>& subtreePath) {
+ [asyncResp](
+ const boost::system::error_code ec,
+ const dbus::utility::MapperGetSubTreePathsResponse&
+ subtreePath) {
if (ec)
{
BMCWEB_LOG_ERROR << ec;
@@ -1513,8 +1511,9 @@
// DBus implementation of EventLog/Entries
// Make call to Logging Service to find all log entry objects
crow::connections::systemBus->async_method_call(
- [asyncResp, entryID](const boost::system::error_code ec,
- const GetManagedPropertyType& resp) {
+ [asyncResp,
+ entryID](const boost::system::error_code ec,
+ const dbus::utility::DBusPropertiesMap& resp) {
if (ec.value() == EBADR)
{
messages::resourceNotFound(
@@ -2614,11 +2613,9 @@
const std::string& logID, nlohmann::json& logEntryJson)
{
auto getStoredLogCallback =
- [asyncResp, logID, &logEntryJson](
- const boost::system::error_code ec,
- const std::vector<
- std::pair<std::string, dbus::utility::DbusVariantType>>&
- params) {
+ [asyncResp, logID,
+ &logEntryJson](const boost::system::error_code ec,
+ const dbus::utility::DBusPropertiesMap& params) {
if (ec)
{
BMCWEB_LOG_DEBUG << "failed to get log ec: " << ec.message();