summaryrefslogtreecommitdiffstats
path: root/user_channel
diff options
context:
space:
mode:
authorWilliam A. Kennington III <wak@google.com>2018-11-19 17:45:35 -0800
committerVernon Mauery <vernon.mauery@linux.intel.com>2018-11-26 16:41:57 +0000
commitdfad4863541f2315f02dd1c95cd7d4e8b688f697 (patch)
tree2eec6fc030218a92e9ff1279898109eeda500e65 /user_channel
parent9cc0ea5f245b215e9eea41b9861f704c6b305671 (diff)
downloadphosphor-host-ipmid-dfad4863541f2315f02dd1c95cd7d4e8b688f697.tar.gz
phosphor-host-ipmid-dfad4863541f2315f02dd1c95cd7d4e8b688f697.zip
std::variant: Fix new instances of mapbox specific calls
Tested: Build and run through unit tests. Change-Id: I87f2d5441b2f029e1e96ee1b46c4c760b0d82aac Signed-off-by: William A. Kennington III <wak@google.com>
Diffstat (limited to 'user_channel')
-rw-r--r--user_channel/channel_mgmt.cpp7
-rw-r--r--user_channel/user_mgmt.cpp20
2 files changed, 16 insertions, 11 deletions
diff --git a/user_channel/channel_mgmt.cpp b/user_channel/channel_mgmt.cpp
index fc2ca1b..14b350e 100644
--- a/user_channel/channel_mgmt.cpp
+++ b/user_channel/channel_mgmt.cpp
@@ -34,6 +34,7 @@
namespace ipmi
{
+namespace variant_ns = sdbusplus::message::variant_ns;
using namespace phosphor::logging;
static constexpr const char* channelAccessDefaultFilename =
@@ -198,7 +199,7 @@ void processChAccessPropChange(ChannelConfig& chConfig, const std::string& path,
if (prop.first == privilegePropertyString)
{
propName = privilegePropertyString;
- intfPrivStr = prop.second.get<std::string>();
+ intfPrivStr = variant_ns::get<std::string>(prop.second);
break;
}
}
@@ -1347,9 +1348,9 @@ int ChannelConfig::syncNetworkChannelConfig()
entry("INTERFACE:%s", intfName.c_str()));
continue;
}
- intfPrivStr = variant.get<std::string>();
+ intfPrivStr = variant_ns::get<std::string>(variant);
}
- catch (const mapbox::util::bad_variant_access& e)
+ catch (const variant_ns::bad_variant_access& e)
{
log<level::DEBUG>(
"exception: Network interface does not exist");
diff --git a/user_channel/user_mgmt.cpp b/user_channel/user_mgmt.cpp
index e90bff6..7a11ff3 100644
--- a/user_channel/user_mgmt.cpp
+++ b/user_channel/user_mgmt.cpp
@@ -103,6 +103,8 @@ static std::array<std::string, (PRIVILEGE_OEM + 1)> ipmiPrivIndex = {
"priv-custom" // PRIVILEGE_OEM - 5
};
+namespace variant_ns = sdbusplus::message::variant_ns;
+
using namespace phosphor::logging;
using Json = nlohmann::json;
@@ -371,17 +373,17 @@ void userUpdatedSignalHandler(UserAccess& usrAccess,
std::string member = prop.first;
if (member == userPrivProperty)
{
- priv = prop.second.get<std::string>();
+ priv = variant_ns::get<std::string>(prop.second);
userEvent = UserUpdateEvent::userPrivUpdated;
}
else if (member == userGrpProperty)
{
- groups = prop.second.get<std::vector<std::string>>();
+ groups = variant_ns::get<std::vector<std::string>>(prop.second);
userEvent = UserUpdateEvent::userGrpUpdated;
}
else if (member == userEnabledProperty)
{
- enabled = prop.second.get<bool>();
+ enabled = variant_ns::get<bool>(prop.second);
userEvent = UserUpdateEvent::userStateUpdated;
}
// Process based on event type.
@@ -1134,11 +1136,13 @@ void UserAccess::getSystemPrivAndGroups()
auto key = t.first;
if (key == allPrivProperty)
{
- availablePrivileges = t.second.get<std::vector<std::string>>();
+ availablePrivileges =
+ variant_ns::get<std::vector<std::string>>(t.second);
}
else if (key == allGrpProperty)
{
- availableGroups = t.second.get<std::vector<std::string>>();
+ availableGroups =
+ variant_ns::get<std::vector<std::string>>(t.second);
}
}
// TODO: Implement Supported Privilege & Groups verification logic
@@ -1165,15 +1169,15 @@ void UserAccess::getUserProperties(const DbusUserObjProperties& properties,
std::string key = t.first;
if (key == userPrivProperty)
{
- usrPriv = t.second.get<std::string>();
+ usrPriv = variant_ns::get<std::string>(t.second);
}
else if (key == userGrpProperty)
{
- usrGrps = t.second.get<std::vector<std::string>>();
+ usrGrps = variant_ns::get<std::vector<std::string>>(t.second);
}
else if (key == userEnabledProperty)
{
- usrEnabled = t.second.get<bool>();
+ usrEnabled = variant_ns::get<bool>(t.second);
}
}
return;
OpenPOWER on IntegriCloud