Fix the build
It's not clear why CI doesn't catch this, but these calls don't really
seem to want to be done inline. Declare variables for them.
Tested: Code compiles on older gcc
Change-Id: Id6123b1d9f0f90a26ef2f19ed6c4deaf69c44588
Signed-off-by: Ed Tanous <etanous@nvidia.com>
diff --git a/redfish-core/lib/systems.hpp b/redfish-core/lib/systems.hpp
index c6b6bb1..7057533 100644
--- a/redfish-core/lib/systems.hpp
+++ b/redfish-core/lib/systems.hpp
@@ -475,10 +475,10 @@
const uint64_t computerSystemIndex)
{
BMCWEB_LOG_DEBUG("Get host information.");
-
+ sdbusplus::message::object_path path =
+ getHostStateObjectPath(computerSystemIndex);
dbus::utility::getProperty<std::string>(
- getHostStateServiceName(computerSystemIndex),
- getHostStateObjectPath(computerSystemIndex),
+ getHostStateServiceName(computerSystemIndex), path,
"xyz.openbmc_project.State.Host", "CurrentHostState",
[asyncResp](const boost::system::error_code& ec,
const std::string& hostState) {
@@ -779,11 +779,12 @@
inline void getBootProgress(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const uint64_t computerSystemIndex)
{
+ sdbusplus::message::object_path path =
+ getHostStateObjectPath(computerSystemIndex);
dbus::utility::getProperty<std::string>(
- getHostStateServiceName(computerSystemIndex),
- getHostStateObjectPath(computerSystemIndex),
+ getHostStateServiceName(computerSystemIndex), path,
"xyz.openbmc_project.State.Boot.Progress", "BootProgress",
- [asyncResp](const boost::system::error_code& ec,
+ [asyncResp](const boost::system::error_code ec,
const std::string& bootProgressStr) {
if (ec)
{
@@ -811,9 +812,10 @@
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const uint64_t computerSystemIndex)
{
+ sdbusplus::message::object_path path =
+ getHostStateObjectPath(computerSystemIndex);
dbus::utility::getProperty<uint64_t>(
- getHostStateServiceName(computerSystemIndex),
- getHostStateObjectPath(computerSystemIndex),
+ getHostStateServiceName(computerSystemIndex), path,
"xyz.openbmc_project.State.Boot.Progress", "BootProgressLastUpdate",
[asyncResp](const boost::system::error_code& ec,
const uint64_t lastStateTime) {
@@ -1113,10 +1115,10 @@
const uint64_t computerSystemIndex)
{
BMCWEB_LOG_DEBUG("Getting System Last Reset Time");
-
+ sdbusplus::message::object_path path =
+ getChassisStateObjectPath(computerSystemIndex);
dbus::utility::getProperty<uint64_t>(
- getChassisStateServiceName(computerSystemIndex),
- getChassisStateObjectPath(computerSystemIndex),
+ getChassisStateServiceName(computerSystemIndex), path,
"xyz.openbmc_project.State.Chassis", "LastStateChangeTime",
[asyncResp](const boost::system::error_code& ec,
uint64_t lastResetTime) {
@@ -1154,10 +1156,10 @@
const uint64_t computerSystemIndex)
{
BMCWEB_LOG_DEBUG("Get Automatic Retry policy");
-
+ sdbusplus::message::object_path path =
+ getHostStateObjectPath(computerSystemIndex);
dbus::utility::getAllProperties(
- getHostStateServiceName(computerSystemIndex),
- getHostStateObjectPath(computerSystemIndex),
+ getHostStateServiceName(computerSystemIndex), path,
"xyz.openbmc_project.Control.Boot.RebootAttempts",
[asyncResp{asyncResp}](
const boost::system::error_code& ec,
@@ -3528,9 +3530,10 @@
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const uint64_t computerSystemIndex)
{
+ sdbusplus::message::object_path path =
+ getHostStateObjectPath(computerSystemIndex);
dbus::utility::getProperty<std::vector<std::string>>(
- getHostStateServiceName(computerSystemIndex),
- getHostStateObjectPath(computerSystemIndex),
+ getHostStateServiceName(computerSystemIndex), path,
"xyz.openbmc_project.State.Host", "AllowedHostTransitions",
std::bind_front(afterGetAllowedHostTransitions, asyncResp));
}