sdbusplus: remove deprecated variant_ns
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ie9d2f9838212aba7e3201f8af43586c48e273189
diff --git a/bmc_state_manager.cpp b/bmc_state_manager.cpp
index 1ab3f7e..1b7d311 100644
--- a/bmc_state_manager.cpp
+++ b/bmc_state_manager.cpp
@@ -75,8 +75,7 @@
return;
}
- auto currentStateStr =
- sdbusplus::message::variant_ns::get<std::string>(currentState);
+ auto currentStateStr = std::get<std::string>(currentState);
if (currentStateStr == activeState)
{
log<level::INFO>("Setting the BMCState field",
diff --git a/chassis_state_manager.cpp b/chassis_state_manager.cpp
index e71e4b5..c8a0665 100644
--- a/chassis_state_manager.cpp
+++ b/chassis_state_manager.cpp
@@ -82,7 +82,7 @@
auto reply = this->bus.call(method);
reply.read(pgood);
- if (sdbusplus::message::variant_ns::get<int>(pgood) == 1)
+ if (std::get<int>(pgood) == 1)
{
log<level::INFO>("Initial Chassis State will be On",
entry("CHASSIS_CURRENT_POWER_STATE=%s",
@@ -190,8 +190,7 @@
return false;
}
- const auto& currentStateStr =
- sdbusplus::message::variant_ns::get<std::string>(currentState);
+ const auto& currentStateStr = std::get<std::string>(currentState);
return currentStateStr == ACTIVE_STATE ||
currentStateStr == ACTIVATING_STATE;
}
diff --git a/discover_system_state.cpp b/discover_system_state.cpp
index 836011a..8038dd7 100644
--- a/discover_system_state.cpp
+++ b/discover_system_state.cpp
@@ -87,14 +87,14 @@
throw;
}
- if (sdbusplus::message::variant_ns::get<std::string>(property).empty())
+ if (std::get<std::string>(property).empty())
{
log<level::ERR>("Error reading property response",
entry("PROPERTY=%s", propertyName.c_str()));
throw std::runtime_error("Error reading property response");
}
- return sdbusplus::message::variant_ns::get<std::string>(property);
+ return std::get<std::string>(property);
}
void setProperty(sdbusplus::bus::bus& bus, const std::string& path,
@@ -170,7 +170,7 @@
elog<InternalFailure>();
}
- auto powerPolicy = sdbusplus::message::variant_ns::get<std::string>(result);
+ auto powerPolicy = std::get<std::string>(result);
log<level::INFO>("Host power is off, checking power policy",
entry("POWER_POLICY=%s", powerPolicy.c_str()));
diff --git a/host_state_manager.cpp b/host_state_manager.cpp
index bdc2a86..c333032 100644
--- a/host_state_manager.cpp
+++ b/host_state_manager.cpp
@@ -173,8 +173,7 @@
return false;
}
- const auto& currentStateStr =
- sdbusplus::message::variant_ns::get<std::string>(currentState);
+ const auto& currentStateStr = std::get<std::string>(currentState);
return currentStateStr == ACTIVE_STATE ||
currentStateStr == ACTIVATING_STATE;
}
@@ -194,7 +193,7 @@
sdbusplus::message::variant<bool> result;
reply.read(result);
- auto autoReboot = sdbusplus::message::variant_ns::get<bool>(result);
+ auto autoReboot = std::get<bool>(result);
auto rebootCounterParam = reboot::RebootAttempts::attemptsLeft();
if (autoReboot)