diff options
author | Ed Tanous <edtanous@google.com> | 2022-02-27 08:42:46 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2022-03-22 20:53:16 +0300 |
commit | b9d36b4791d77a47e1f3c5c4564fcdf7cc68c115 (patch) | |
tree | 22a37e506310ded94a45aed79799929f94bac330 /include/hostname_monitor.hpp | |
parent | a2dd60a69046cdda90077463f614140aeb91edc4 (diff) | |
download | bmcweb-b9d36b4791d77a47e1f3c5c4564fcdf7cc68c115.tar.xz |
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
Diffstat (limited to 'include/hostname_monitor.hpp')
-rw-r--r-- | include/hostname_monitor.hpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/include/hostname_monitor.hpp b/include/hostname_monitor.hpp index 73c315fb73..f4e6b27c2d 100644 --- a/include/hostname_monitor.hpp +++ b/include/hostname_monitor.hpp @@ -1,7 +1,7 @@ #pragma once #ifdef BMCWEB_ENABLE_SSL -#include <boost/container/flat_map.hpp> #include <dbus_singleton.hpp> +#include <dbus_utility.hpp> #include <include/dbus_utility.hpp> #include <sdbusplus/bus/match.hpp> #include <sdbusplus/message/types.hpp> @@ -43,20 +43,19 @@ inline int onPropertyUpdate(sd_bus_message* m, void* /* userdata */, sdbusplus::message::message message(m); std::string iface; - boost::container::flat_map<std::string, dbus::utility::DbusVariantType> - changedProperties; + dbus::utility::DBusPropertiesMap changedProperties; message.read(iface, changedProperties); - auto it = changedProperties.find("HostName"); - if (it == changedProperties.end()) + const std::string* hostname = nullptr; + for (const auto& propertyPair : changedProperties) { - return 0; + if (propertyPair.first == "HostName") + { + hostname = std::get_if<std::string>(&propertyPair.second); + } } - - std::string* hostname = std::get_if<std::string>(&it->second); if (hostname == nullptr) { - BMCWEB_LOG_ERROR << "Unable to read hostname"; return 0; } |