summaryrefslogtreecommitdiffstats
path: root/src/snmp_trap.cpp
diff options
context:
space:
mode:
authorWilliam A. Kennington III <wak@google.com>2018-11-12 15:54:32 -0800
committerWilliam A. Kennington III <wak@google.com>2018-11-12 16:51:49 -0800
commitefcd653d7419d6f14274f707f47fc6f9120202fe (patch)
tree8555c654745c83eb33e736485ec2485a46236118 /src/snmp_trap.cpp
parent0b45a3ce6d21e70453ed3d4a7dfcc2bef0865e7f (diff)
downloadphosphor-dbus-monitor-efcd653d7419d6f14274f707f47fc6f9120202fe.tar.gz
phosphor-dbus-monitor-efcd653d7419d6f14274f707f47fc6f9120202fe.zip
std::variant: Fixup .get() usage
This is just a refactor from the mapbox specific .get() interface to the common std::variant ::get<>() interface. Tested: Built and run through unit tests. Change-Id: Ic0737f632e80c9dd5b73717ec33d31f245f107db Signed-off-by: William A. Kennington III <wak@google.com>
Diffstat (limited to 'src/snmp_trap.cpp')
-rw-r--r--src/snmp_trap.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/snmp_trap.cpp b/src/snmp_trap.cpp
index cc730b7..eb2efd3 100644
--- a/src/snmp_trap.cpp
+++ b/src/snmp_trap.cpp
@@ -33,11 +33,15 @@ void ErrorTrap::trap(sdbusplus::message::message& msg) const
return;
}
auto& propMap = it->second;
- auto errorID = propMap.at("Id").get<uint32_t>();
- auto timestamp = propMap.at("Timestamp").get<uint64_t>();
- auto sev = propMap.at("Severity").get<std::string>();
+ auto errorID =
+ sdbusplus::message::variant_ns::get<uint32_t>(propMap.at("Id"));
+ auto timestamp =
+ sdbusplus::message::variant_ns::get<uint64_t>(propMap.at("Timestamp"));
+ auto sev = sdbusplus::message::variant_ns::get<std::string>(
+ propMap.at("Severity"));
auto isev = static_cast<uint8_t>(Entry::convertLevelFromString(sev));
- auto message = propMap.at("Message").get<std::string>();
+ auto message =
+ sdbusplus::message::variant_ns::get<std::string>(propMap.at("Message"));
try
{
sendTrap<OBMCErrorNotification>(errorID, timestamp, isev, message);
OpenPOWER on IntegriCloud