clang-format: re-format for clang-18
clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda formatting also changed, so we have made changes to the
organization default style format to better handle lambda formatting.
See I5e08687e696dd240402a2780158664b7113def0e for updated style.
See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.
Change-Id: Iceec1dc95b6c908ec6c21fb40093de9dd18bf11a
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/redfish-core/include/utils/chassis_utils.hpp b/redfish-core/include/utils/chassis_utils.hpp
index 410a289..889b6f7 100644
--- a/redfish-core/include/utils/chassis_utils.hpp
+++ b/redfish-core/include/utils/chassis_utils.hpp
@@ -33,33 +33,33 @@
chassisId](const boost::system::error_code& ec,
const dbus::utility::MapperGetSubTreePathsResponse&
chassisPaths) mutable {
- BMCWEB_LOG_DEBUG("getValidChassisPath respHandler enter");
- if (ec)
- {
- BMCWEB_LOG_ERROR("getValidChassisPath respHandler DBUS error: {}",
- ec);
- messages::internalError(asyncResp->res);
- return;
- }
+ BMCWEB_LOG_DEBUG("getValidChassisPath respHandler enter");
+ if (ec)
+ {
+ BMCWEB_LOG_ERROR(
+ "getValidChassisPath respHandler DBUS error: {}", ec);
+ messages::internalError(asyncResp->res);
+ return;
+ }
- std::optional<std::string> chassisPath;
- for (const std::string& chassis : chassisPaths)
- {
- sdbusplus::message::object_path path(chassis);
- std::string chassisName = path.filename();
- if (chassisName.empty())
+ std::optional<std::string> chassisPath;
+ for (const std::string& chassis : chassisPaths)
{
- BMCWEB_LOG_ERROR("Failed to find '/' in {}", chassis);
- continue;
+ sdbusplus::message::object_path path(chassis);
+ std::string chassisName = path.filename();
+ if (chassisName.empty())
+ {
+ BMCWEB_LOG_ERROR("Failed to find '/' in {}", chassis);
+ continue;
+ }
+ if (chassisName == chassisId)
+ {
+ chassisPath = chassis;
+ break;
+ }
}
- if (chassisName == chassisId)
- {
- chassisPath = chassis;
- break;
- }
- }
- callback(chassisPath);
- });
+ callback(chassisPath);
+ });
BMCWEB_LOG_DEBUG("checkChassisId exit");
}
diff --git a/redfish-core/include/utils/collection.hpp b/redfish-core/include/utils/collection.hpp
index 9efa7d3..6528a98 100644
--- a/redfish-core/include/utils/collection.hpp
+++ b/redfish-core/include/utils/collection.hpp
@@ -92,24 +92,22 @@
*
* @return void
*/
-inline void
- getCollectionToKey(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
- const boost::urls::url& collectionPath,
- std::span<const std::string_view> interfaces,
- const std::string& subtree,
- const nlohmann::json::json_pointer& jsonKeyName)
+inline void getCollectionToKey(
+ const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+ const boost::urls::url& collectionPath,
+ std::span<const std::string_view> interfaces, const std::string& subtree,
+ const nlohmann::json::json_pointer& jsonKeyName)
{
BMCWEB_LOG_DEBUG("Get collection members for: {}", collectionPath.buffer());
- dbus::utility::getSubTreePaths(subtree, 0, interfaces,
- std::bind_front(handleCollectionMembers,
- asyncResp, collectionPath,
- jsonKeyName));
+ dbus::utility::getSubTreePaths(
+ subtree, 0, interfaces,
+ std::bind_front(handleCollectionMembers, asyncResp, collectionPath,
+ jsonKeyName));
}
-inline void
- getCollectionMembers(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
- const boost::urls::url& collectionPath,
- std::span<const std::string_view> interfaces,
- const std::string& subtree)
+inline void getCollectionMembers(
+ const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+ const boost::urls::url& collectionPath,
+ std::span<const std::string_view> interfaces, const std::string& subtree)
{
getCollectionToKey(asyncResp, collectionPath, interfaces, subtree,
nlohmann::json::json_pointer("/Members"));
diff --git a/redfish-core/include/utils/dbus_utils.hpp b/redfish-core/include/utils/dbus_utils.hpp
index dbb6fd1..3fcd2c7 100644
--- a/redfish-core/include/utils/dbus_utils.hpp
+++ b/redfish-core/include/utils/dbus_utils.hpp
@@ -34,11 +34,10 @@
namespace details
{
-void afterSetProperty(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
- const std::string& redfishPropertyName,
- const nlohmann::json& propertyValue,
- const boost::system::error_code& ec,
- const sdbusplus::message_t& msg);
+void afterSetProperty(
+ const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+ const std::string& redfishPropertyName, const nlohmann::json& propertyValue,
+ const boost::system::error_code& ec, const sdbusplus::message_t& msg);
void afterSetPropertyAction(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& redfishActionName,
@@ -48,12 +47,11 @@
} // namespace details
template <typename PropertyType>
-void setDbusProperty(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
- std::string_view redfishPropertyName,
- std::string_view processName,
- const sdbusplus::message::object_path& path,
- std::string_view interface, std::string_view dbusProperty,
- const PropertyType& prop)
+void setDbusProperty(
+ const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+ std::string_view redfishPropertyName, std::string_view processName,
+ const sdbusplus::message::object_path& path, std::string_view interface,
+ std::string_view dbusProperty, const PropertyType& prop)
{
std::string processNameStr(processName);
std::string interfaceStr(interface);
@@ -65,20 +63,18 @@
[asyncResp, redfishPropertyNameStr = std::string{redfishPropertyName},
jsonProp = nlohmann::json(prop)](const boost::system::error_code& ec,
const sdbusplus::message_t& msg) {
- details::afterSetProperty(asyncResp, redfishPropertyNameStr, jsonProp,
- ec, msg);
- });
+ details::afterSetProperty(asyncResp, redfishPropertyNameStr,
+ jsonProp, ec, msg);
+ });
}
template <typename DbusPropertyType>
-void setDbusPropertyAction(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
- std::string_view processName,
- const sdbusplus::message::object_path& path,
- std::string_view interface,
- std::string_view dbusProperty,
- std::string_view redfishActionParameterName,
- std::string_view redfishActionName,
- const DbusPropertyType& prop)
+void setDbusPropertyAction(
+ const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+ std::string_view processName, const sdbusplus::message::object_path& path,
+ std::string_view interface, std::string_view dbusProperty,
+ std::string_view redfishActionParameterName,
+ std::string_view redfishActionName, const DbusPropertyType& prop)
{
std::string processNameStr(processName);
std::string interfaceStr(interface);
@@ -93,9 +89,10 @@
redfishActionNameStr = std::string{redfishActionName}](
const boost::system::error_code& ec,
const sdbusplus::message_t& msg) {
- details::afterSetPropertyAction(asyncResp, redfishActionNameStr,
- redfishActionParameterName, ec, msg);
- });
+ details::afterSetPropertyAction(asyncResp, redfishActionNameStr,
+ redfishActionParameterName, ec,
+ msg);
+ });
}
} // namespace redfish
diff --git a/redfish-core/include/utils/json_utils.hpp b/redfish-core/include/utils/json_utils.hpp
index f6ac70b..bc1a69a 100644
--- a/redfish-core/include/utils/json_utils.hpp
+++ b/redfish-core/include/utils/json_utils.hpp
@@ -209,8 +209,8 @@
value = static_cast<Type>(*jsonPtr);
}
- else if constexpr ((std::is_unsigned_v<Type>)&&(
- !std::is_same_v<bool, Type>))
+ else if constexpr ((std::is_unsigned_v<Type>) &&
+ (!std::is_same_v<bool, Type>))
{
uint64_t* jsonPtr = jsonValue.get_ptr<uint64_t*>();
if (jsonPtr == nullptr)
@@ -560,15 +560,16 @@
break;
}
- result = std::visit(
- [&item, &unpackSpec, &res](auto&& val) {
- using ContainedT =
- std::remove_pointer_t<std::decay_t<decltype(val)>>;
- return details::unpackValue<ContainedT>(
- item.second, unpackSpec.key, res, *val);
- },
- unpackSpec.value) &&
- result;
+ result =
+ std::visit(
+ [&item, &unpackSpec, &res](auto&& val) {
+ using ContainedT =
+ std::remove_pointer_t<std::decay_t<decltype(val)>>;
+ return details::unpackValue<ContainedT>(
+ item.second, unpackSpec.key, res, *val);
+ },
+ unpackSpec.value) &&
+ result;
unpackSpec.complete = true;
break;
@@ -587,10 +588,10 @@
{
bool isOptional = std::visit(
[](auto&& val) {
- using ContainedType =
- std::remove_pointer_t<std::decay_t<decltype(val)>>;
- return details::IsOptional<ContainedType>::value;
- },
+ using ContainedType =
+ std::remove_pointer_t<std::decay_t<decltype(val)>>;
+ return details::IsOptional<ContainedType>::value;
+ },
perUnpack.value);
if (isOptional)
{
@@ -679,8 +680,8 @@
}
std::erase_if(*object,
[](const std::pair<std::string, nlohmann::json>& item) {
- return item.first.starts_with("@odata.");
- });
+ return item.first.starts_with("@odata.");
+ });
if (object->empty())
{
// If the update request only contains OData annotations, the service
diff --git a/redfish-core/include/utils/query_param.hpp b/redfish-core/include/utils/query_param.hpp
index 3ec4dc3..5de3967 100644
--- a/redfish-core/include/utils/query_param.hpp
+++ b/redfish-core/include/utils/query_param.hpp
@@ -310,8 +310,8 @@
inline QueryError getNumericParam(std::string_view value, size_t& param)
{
- std::from_chars_result r = std::from_chars(value.begin(), value.end(),
- param);
+ std::from_chars_result r =
+ std::from_chars(value.begin(), value.end(), param);
// If the number wasn't representable in the type, it's out of range
if (r.ec == std::errc::result_out_of_range)
@@ -387,8 +387,8 @@
return query.filter.has_value();
}
-inline std::optional<Query> parseParameters(boost::urls::params_view urlParams,
- crow::Response& res)
+inline std::optional<Query>
+ parseParameters(boost::urls::params_view urlParams, crow::Response& res)
{
Query ret{};
for (const boost::urls::params_view::value_type& it : urlParams)
@@ -698,9 +698,8 @@
// Isn't a concern until https://gerrit.openbmc.org/c/openbmc/bmcweb/+/60556
// lands. May want to avoid forwarding query params when request is uptree from
// a top level collection.
-inline std::vector<ExpandNode>
- findNavigationReferences(ExpandType eType, int depth, int skipDepth,
- nlohmann::json& jsonResponse)
+inline std::vector<ExpandNode> findNavigationReferences(
+ ExpandType eType, int depth, int skipDepth, nlohmann::json& jsonResponse)
{
std::vector<ExpandNode> ret;
const nlohmann::json::json_pointer root = nlohmann::json::json_pointer("");
@@ -790,8 +789,9 @@
if (finalCodeIndex != std::numeric_limits<size_t>::max() &&
subResponseCodeIndex != std::numeric_limits<size_t>::max())
{
- return finalCodeIndex <= subResponseCodeIndex ? finalCode
- : subResponseCode;
+ return finalCodeIndex <= subResponseCodeIndex
+ ? finalCode
+ : subResponseCode;
}
if (subResponseCode == 500 || finalCode == 500)
{
@@ -832,8 +832,7 @@
// class manages the final "merge" of the json resources.
MultiAsyncResp(crow::App& appIn,
std::shared_ptr<bmcweb::AsyncResp> finalResIn) :
- app(appIn),
- finalRes(std::move(finalResIn))
+ app(appIn), finalRes(std::move(finalResIn))
{}
void addAwaitingResponse(
diff --git a/redfish-core/include/utils/sw_utils.hpp b/redfish-core/include/utils/sw_utils.hpp
index 8455145..fc15783 100644
--- a/redfish-core/include/utils/sw_utils.hpp
+++ b/redfish-core/include/utils/sw_utils.hpp
@@ -99,178 +99,193 @@
populateLinkToImages](
const boost::system::error_code& ec,
const dbus::utility::MapperEndPoints& functionalSw) {
- BMCWEB_LOG_DEBUG("populateSoftwareInformation enter");
- if (ec)
- {
- BMCWEB_LOG_ERROR("error_code = {}", ec);
- BMCWEB_LOG_ERROR("error msg = {}", ec.message());
- messages::internalError(asyncResp->res);
- return;
- }
-
- if (functionalSw.empty())
- {
- // Could keep going and try to populate SoftwareImages but
- // something is seriously wrong, so just fail
- BMCWEB_LOG_ERROR("Zero functional software in system");
- messages::internalError(asyncResp->res);
- return;
- }
-
- std::vector<std::string> functionalSwIds;
- // example functionalSw:
- // v as 2 "/xyz/openbmc_project/software/ace821ef"
- // "/xyz/openbmc_project/software/230fb078"
- for (const auto& sw : functionalSw)
- {
- sdbusplus::message::object_path path(sw);
- std::string leaf = path.filename();
- if (leaf.empty())
+ BMCWEB_LOG_DEBUG("populateSoftwareInformation enter");
+ if (ec)
{
- continue;
- }
-
- functionalSwIds.push_back(leaf);
- }
-
- constexpr std::array<std::string_view, 1> interfaces = {
- "xyz.openbmc_project.Software.Version"};
- dbus::utility::getSubTree(
- "/xyz/openbmc_project/software", 0, interfaces,
- [asyncResp, swVersionPurpose, activeVersionPropName,
- populateLinkToImages, functionalSwIds](
- const boost::system::error_code& ec2,
- const dbus::utility::MapperGetSubTreeResponse& subtree) {
- if (ec2)
- {
- BMCWEB_LOG_ERROR("error_code = {}", ec2);
- BMCWEB_LOG_ERROR("error msg = {}", ec2.message());
+ BMCWEB_LOG_ERROR("error_code = {}", ec);
+ BMCWEB_LOG_ERROR("error msg = {}", ec.message());
messages::internalError(asyncResp->res);
return;
}
- BMCWEB_LOG_DEBUG("Found {} images", subtree.size());
-
- for (const std::pair<std::string,
- std::vector<std::pair<
- std::string, std::vector<std::string>>>>&
- obj : subtree)
+ if (functionalSw.empty())
{
- sdbusplus::message::object_path path(obj.first);
- std::string swId = path.filename();
- if (swId.empty())
- {
- messages::internalError(asyncResp->res);
- BMCWEB_LOG_ERROR("Invalid software ID");
+ // Could keep going and try to populate SoftwareImages but
+ // something is seriously wrong, so just fail
+ BMCWEB_LOG_ERROR("Zero functional software in system");
+ messages::internalError(asyncResp->res);
+ return;
+ }
- return;
+ std::vector<std::string> functionalSwIds;
+ // example functionalSw:
+ // v as 2 "/xyz/openbmc_project/software/ace821ef"
+ // "/xyz/openbmc_project/software/230fb078"
+ for (const auto& sw : functionalSw)
+ {
+ sdbusplus::message::object_path path(sw);
+ std::string leaf = path.filename();
+ if (leaf.empty())
+ {
+ continue;
}
- bool runningImage = false;
- // Look at Ids from
- // /xyz/openbmc_project/software/functional
- // to determine if this is a running image
- if (std::ranges::find(functionalSwIds, swId) !=
- functionalSwIds.end())
- {
- runningImage = true;
- }
+ functionalSwIds.push_back(leaf);
+ }
- // Now grab its version info
- sdbusplus::asio::getAllProperties(
- *crow::connections::systemBus, obj.second[0].first,
- obj.first, "xyz.openbmc_project.Software.Version",
- [asyncResp, swId, runningImage, swVersionPurpose,
- activeVersionPropName, populateLinkToImages](
- const boost::system::error_code& ec3,
- const dbus::utility::DBusPropertiesMap&
- propertiesList) {
- if (ec3)
+ constexpr std::array<std::string_view, 1> interfaces = {
+ "xyz.openbmc_project.Software.Version"};
+ dbus::utility::getSubTree(
+ "/xyz/openbmc_project/software", 0, interfaces,
+ [asyncResp, swVersionPurpose, activeVersionPropName,
+ populateLinkToImages, functionalSwIds](
+ const boost::system::error_code& ec2,
+ const dbus::utility::MapperGetSubTreeResponse& subtree) {
+ if (ec2)
{
- BMCWEB_LOG_ERROR("error_code = {}", ec3);
- BMCWEB_LOG_ERROR("error msg = {}", ec3.message());
- // Have seen the code update app delete the D-Bus
- // object, during code update, between the call to
- // mapper and here. Just leave these properties off if
- // resource not found.
- if (ec3.value() == EBADR)
+ BMCWEB_LOG_ERROR("error_code = {}", ec2);
+ BMCWEB_LOG_ERROR("error msg = {}", ec2.message());
+ messages::internalError(asyncResp->res);
+ return;
+ }
+
+ BMCWEB_LOG_DEBUG("Found {} images", subtree.size());
+
+ for (const std::pair<
+ std::string,
+ std::vector<std::pair<
+ std::string, std::vector<std::string>>>>& obj :
+ subtree)
+ {
+ sdbusplus::message::object_path path(obj.first);
+ std::string swId = path.filename();
+ if (swId.empty())
{
+ messages::internalError(asyncResp->res);
+ BMCWEB_LOG_ERROR("Invalid software ID");
+
return;
}
- messages::internalError(asyncResp->res);
- return;
- }
- // example propertiesList
- // a{sv} 2 "Version" s
- // "IBM-witherspoon-OP9-v2.0.10-2.22" "Purpose"
- // s
- // "xyz.openbmc_project.Software.Version.VersionPurpose.Host"
- const std::string* version = nullptr;
- const std::string* swInvPurpose = nullptr;
- const bool success = sdbusplus::unpackPropertiesNoThrow(
- dbus_utils::UnpackErrorPrinter(), propertiesList,
- "Purpose", swInvPurpose, "Version", version);
-
- if (!success)
- {
- messages::internalError(asyncResp->res);
- return;
- }
-
- if (version == nullptr || version->empty())
- {
- messages::internalError(asyncResp->res);
- return;
- }
- if (swInvPurpose == nullptr ||
- *swInvPurpose != swVersionPurpose)
- {
- // Not purpose we're looking for
- return;
- }
-
- BMCWEB_LOG_DEBUG("Image ID: {}", swId);
- BMCWEB_LOG_DEBUG("Running image: {}", runningImage);
- BMCWEB_LOG_DEBUG("Image purpose: {}", *swInvPurpose);
-
- if (populateLinkToImages)
- {
- nlohmann::json& softwareImageMembers =
- asyncResp->res.jsonValue["Links"]["SoftwareImages"];
- // Firmware images are at
- // /redfish/v1/UpdateService/FirmwareInventory/<Id>
- // e.g. .../FirmwareInventory/82d3ec86
- nlohmann::json::object_t member;
- member["@odata.id"] = boost::urls::format(
- "/redfish/v1/UpdateService/FirmwareInventory/{}",
- swId);
- softwareImageMembers.emplace_back(std::move(member));
- asyncResp->res
- .jsonValue["Links"]["SoftwareImages@odata.count"] =
- softwareImageMembers.size();
-
- if (runningImage)
+ bool runningImage = false;
+ // Look at Ids from
+ // /xyz/openbmc_project/software/functional
+ // to determine if this is a running image
+ if (std::ranges::find(functionalSwIds, swId) !=
+ functionalSwIds.end())
{
- nlohmann::json::object_t runningMember;
- runningMember["@odata.id"] = boost::urls::format(
- "/redfish/v1/UpdateService/FirmwareInventory/{}",
- swId);
- // Create the link to the running image
- asyncResp->res
- .jsonValue["Links"]["ActiveSoftwareImage"] =
- std::move(runningMember);
+ runningImage = true;
}
- }
- if (!activeVersionPropName.empty() && runningImage)
- {
- asyncResp->res.jsonValue[activeVersionPropName] =
- *version;
+
+ // Now grab its version info
+ sdbusplus::asio::getAllProperties(
+ *crow::connections::systemBus, obj.second[0].first,
+ obj.first, "xyz.openbmc_project.Software.Version",
+ [asyncResp, swId, runningImage, swVersionPurpose,
+ activeVersionPropName, populateLinkToImages](
+ const boost::system::error_code& ec3,
+ const dbus::utility::DBusPropertiesMap&
+ propertiesList) {
+ if (ec3)
+ {
+ BMCWEB_LOG_ERROR("error_code = {}", ec3);
+ BMCWEB_LOG_ERROR("error msg = {}",
+ ec3.message());
+ // Have seen the code update app delete the
+ // D-Bus object, during code update, between
+ // the call to mapper and here. Just leave
+ // these properties off if resource not
+ // found.
+ if (ec3.value() == EBADR)
+ {
+ return;
+ }
+ messages::internalError(asyncResp->res);
+ return;
+ }
+ // example propertiesList
+ // a{sv} 2 "Version" s
+ // "IBM-witherspoon-OP9-v2.0.10-2.22" "Purpose"
+ // s
+ // "xyz.openbmc_project.Software.Version.VersionPurpose.Host"
+ const std::string* version = nullptr;
+ const std::string* swInvPurpose = nullptr;
+
+ const bool success =
+ sdbusplus::unpackPropertiesNoThrow(
+ dbus_utils::UnpackErrorPrinter(),
+ propertiesList, "Purpose", swInvPurpose,
+ "Version", version);
+
+ if (!success)
+ {
+ messages::internalError(asyncResp->res);
+ return;
+ }
+
+ if (version == nullptr || version->empty())
+ {
+ messages::internalError(asyncResp->res);
+ return;
+ }
+ if (swInvPurpose == nullptr ||
+ *swInvPurpose != swVersionPurpose)
+ {
+ // Not purpose we're looking for
+ return;
+ }
+
+ BMCWEB_LOG_DEBUG("Image ID: {}", swId);
+ BMCWEB_LOG_DEBUG("Running image: {}",
+ runningImage);
+ BMCWEB_LOG_DEBUG("Image purpose: {}",
+ *swInvPurpose);
+
+ if (populateLinkToImages)
+ {
+ nlohmann::json& softwareImageMembers =
+ asyncResp->res
+ .jsonValue["Links"]
+ ["SoftwareImages"];
+ // Firmware images are at
+ // /redfish/v1/UpdateService/FirmwareInventory/<Id>
+ // e.g. .../FirmwareInventory/82d3ec86
+ nlohmann::json::object_t member;
+ member["@odata.id"] = boost::urls::format(
+ "/redfish/v1/UpdateService/FirmwareInventory/{}",
+ swId);
+ softwareImageMembers.emplace_back(
+ std::move(member));
+ asyncResp->res.jsonValue
+ ["Links"]
+ ["SoftwareImages@odata.count"] =
+ softwareImageMembers.size();
+
+ if (runningImage)
+ {
+ nlohmann::json::object_t runningMember;
+ runningMember["@odata.id"] =
+ boost::urls::format(
+ "/redfish/v1/UpdateService/FirmwareInventory/{}",
+ swId);
+ // Create the link to the running image
+ asyncResp->res
+ .jsonValue["Links"]
+ ["ActiveSoftwareImage"] =
+ std::move(runningMember);
+ }
+ }
+ if (!activeVersionPropName.empty() &&
+ runningImage)
+ {
+ asyncResp->res
+ .jsonValue[activeVersionPropName] =
+ *version;
+ }
+ });
}
});
- }
});
- });
}
/**
@@ -351,38 +366,38 @@
[asyncResp,
swId](const boost::system::error_code& ec,
const dbus::utility::DBusPropertiesMap& propertiesList) {
- if (ec)
- {
- // not all swtypes are updateable, this is ok
+ if (ec)
+ {
+ // not all swtypes are updateable, this is ok
+ asyncResp->res.jsonValue["Status"]["State"] =
+ resource::State::Enabled;
+ return;
+ }
+
+ const std::string* swInvActivation = nullptr;
+
+ const bool success = sdbusplus::unpackPropertiesNoThrow(
+ dbus_utils::UnpackErrorPrinter(), propertiesList, "Activation",
+ swInvActivation);
+
+ if (!success)
+ {
+ messages::internalError(asyncResp->res);
+ return;
+ }
+
+ if (swInvActivation == nullptr)
+ {
+ messages::internalError(asyncResp->res);
+ return;
+ }
+
+ BMCWEB_LOG_DEBUG("getSwStatus: Activation {}", *swInvActivation);
asyncResp->res.jsonValue["Status"]["State"] =
- resource::State::Enabled;
- return;
- }
-
- const std::string* swInvActivation = nullptr;
-
- const bool success = sdbusplus::unpackPropertiesNoThrow(
- dbus_utils::UnpackErrorPrinter(), propertiesList, "Activation",
- swInvActivation);
-
- if (!success)
- {
- messages::internalError(asyncResp->res);
- return;
- }
-
- if (swInvActivation == nullptr)
- {
- messages::internalError(asyncResp->res);
- return;
- }
-
- BMCWEB_LOG_DEBUG("getSwStatus: Activation {}", *swInvActivation);
- asyncResp->res.jsonValue["Status"]["State"] =
- getRedfishSwState(*swInvActivation);
- asyncResp->res.jsonValue["Status"]["Health"] =
- getRedfishSwHealth(*swInvActivation);
- });
+ getRedfishSwState(*swInvActivation);
+ asyncResp->res.jsonValue["Status"]["Health"] =
+ getRedfishSwHealth(*swInvActivation);
+ });
}
inline void handleUpdateableEndpoints(