summaryrefslogtreecommitdiff
path: root/redfish-core/include
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2023-06-07 19:24:59 +0300
committerEd Tanous <ed@tanous.net>2023-06-09 19:02:42 +0300
commitac106bf6d10841a25088ed14105a73636ba71519 (patch)
treef8a3994884fc9ad2ce1df6f8ab50590b707c3ff7 /redfish-core/include
parent69c3cf09a67041de8084b5f7fa7b0f54725a27fa (diff)
downloadbmcweb-ac106bf6d10841a25088ed14105a73636ba71519.tar.xz
Consistently name AsyncResp variables
In about half of our code, AsyncResp objects take the name asyncResp, and in the other half they take the name aResp. While the difference between them is negligeble and arbitrary, having two naming conventions makes it more difficult to do automated changes over time via grep. This commit was generated automtatically with the command: git grep -l 'aResp' | xargs sed -i 's|aResp|asyncResp|g' Tested: Code compiles. Change-Id: Id363437b6a78f51e91cbf60aa0a0c2286f36a037 Signed-off-by: Ed Tanous <edtanous@google.com>
Diffstat (limited to 'redfish-core/include')
-rw-r--r--redfish-core/include/utils/collection.hpp16
-rw-r--r--redfish-core/include/utils/pcie_util.hpp4
-rw-r--r--redfish-core/include/utils/sw_utils.hpp47
3 files changed, 34 insertions, 33 deletions
diff --git a/redfish-core/include/utils/collection.hpp b/redfish-core/include/utils/collection.hpp
index 05e4b4df2f..500749cd54 100644
--- a/redfish-core/include/utils/collection.hpp
+++ b/redfish-core/include/utils/collection.hpp
@@ -23,7 +23,7 @@ namespace collection_util
* @brief Populate the collection "Members" from a GetSubTreePaths search of
* inventory
*
- * @param[i,o] aResp Async response object
+ * @param[i,o] asyncResp Async response object
* @param[i] collectionPath Redfish collection path which is used for the
* Members Redfish Path
* @param[i] interfaces List of interfaces to constrain the GetSubTree search
@@ -32,7 +32,7 @@ namespace collection_util
* @return void
*/
inline void
- getCollectionMembers(std::shared_ptr<bmcweb::AsyncResp> aResp,
+ getCollectionMembers(std::shared_ptr<bmcweb::AsyncResp> asyncResp,
const boost::urls::url& collectionPath,
std::span<const std::string_view> interfaces,
const char* subtree = "/xyz/openbmc_project/inventory")
@@ -41,20 +41,20 @@ inline void
<< collectionPath.buffer();
dbus::utility::getSubTreePaths(
subtree, 0, interfaces,
- [collectionPath, aResp{std::move(aResp)}](
+ [collectionPath, asyncResp{std::move(asyncResp)}](
const boost::system::error_code& ec,
const dbus::utility::MapperGetSubTreePathsResponse& objects) {
if (ec == boost::system::errc::io_error)
{
- aResp->res.jsonValue["Members"] = nlohmann::json::array();
- aResp->res.jsonValue["Members@odata.count"] = 0;
+ asyncResp->res.jsonValue["Members"] = nlohmann::json::array();
+ asyncResp->res.jsonValue["Members@odata.count"] = 0;
return;
}
if (ec)
{
BMCWEB_LOG_DEBUG << "DBUS response error " << ec.value();
- messages::internalError(aResp->res);
+ messages::internalError(asyncResp->res);
return;
}
@@ -72,7 +72,7 @@ inline void
std::sort(pathNames.begin(), pathNames.end(),
AlphanumLess<std::string>());
- nlohmann::json& members = aResp->res.jsonValue["Members"];
+ nlohmann::json& members = asyncResp->res.jsonValue["Members"];
members = nlohmann::json::array();
for (const std::string& leaf : pathNames)
{
@@ -82,7 +82,7 @@ inline void
member["@odata.id"] = std::move(url);
members.emplace_back(std::move(member));
}
- aResp->res.jsonValue["Members@odata.count"] = members.size();
+ asyncResp->res.jsonValue["Members@odata.count"] = members.size();
});
}
diff --git a/redfish-core/include/utils/pcie_util.hpp b/redfish-core/include/utils/pcie_util.hpp
index 51423b435f..7b094feed1 100644
--- a/redfish-core/include/utils/pcie_util.hpp
+++ b/redfish-core/include/utils/pcie_util.hpp
@@ -23,8 +23,8 @@ namespace pcie_util
* @brief Populate the PCIe Device list from a GetSubTreePaths search of
* inventory
*
- * @param[i,o] aResp Async response object
- * @param[i] Name Key to store the list of PCIe devices in aResp
+ * @param[i,o] asyncResp Async response object
+ * @param[i] Name Key to store the list of PCIe devices in asyncResp
*
* @return void
*/
diff --git a/redfish-core/include/utils/sw_utils.hpp b/redfish-core/include/utils/sw_utils.hpp
index de4868bceb..a46dd5a519 100644
--- a/redfish-core/include/utils/sw_utils.hpp
+++ b/redfish-core/include/utils/sw_utils.hpp
@@ -32,26 +32,26 @@ constexpr const char* bmcPurpose =
/**
* @brief Populate the running software version and image links
*
- * @param[i,o] aResp Async response object
+ * @param[i,o] asyncResp Async response object
* @param[i] swVersionPurpose Indicates what target to look for
- * @param[i] activeVersionPropName Index in aResp->res.jsonValue to write
+ * @param[i] activeVersionPropName Index in asyncResp->res.jsonValue to write
* the running software version to
- * @param[i] populateLinkToImages Populate aResp->res "Links"
+ * @param[i] populateLinkToImages Populate asyncResp->res "Links"
* "ActiveSoftwareImage" with a link to the running software image and
* "SoftwareImages" with a link to the all its software images
*
* @return void
*/
-inline void
- populateSoftwareInformation(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
- const std::string& swVersionPurpose,
- const std::string& activeVersionPropName,
- const bool populateLinkToImages)
+inline void populateSoftwareInformation(
+ const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+ const std::string& swVersionPurpose,
+ const std::string& activeVersionPropName, const bool populateLinkToImages)
{
// Used later to determine running (known on Redfish as active) Sw images
dbus::utility::getAssociationEndPoints(
"/xyz/openbmc_project/software/functional",
- [aResp, swVersionPurpose, activeVersionPropName, populateLinkToImages](
+ [asyncResp, swVersionPurpose, activeVersionPropName,
+ populateLinkToImages](
const boost::system::error_code& ec,
const dbus::utility::MapperEndPoints& functionalSw) {
BMCWEB_LOG_DEBUG << "populateSoftwareInformation enter";
@@ -59,7 +59,7 @@ inline void
{
BMCWEB_LOG_ERROR << "error_code = " << ec;
BMCWEB_LOG_ERROR << "error msg = " << ec.message();
- messages::internalError(aResp->res);
+ messages::internalError(asyncResp->res);
return;
}
@@ -68,7 +68,7 @@ inline void
// 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(aResp->res);
+ messages::internalError(asyncResp->res);
return;
}
@@ -92,7 +92,7 @@ inline void
"xyz.openbmc_project.Software.Version"};
dbus::utility::getSubTree(
"/xyz/openbmc_project/software", 0, interfaces,
- [aResp, swVersionPurpose, activeVersionPropName,
+ [asyncResp, swVersionPurpose, activeVersionPropName,
populateLinkToImages, functionalSwIds](
const boost::system::error_code& ec2,
const dbus::utility::MapperGetSubTreeResponse& subtree) {
@@ -100,7 +100,7 @@ inline void
{
BMCWEB_LOG_ERROR << "error_code = " << ec2;
BMCWEB_LOG_ERROR << "error msg = " << ec2.message();
- messages::internalError(aResp->res);
+ messages::internalError(asyncResp->res);
return;
}
@@ -115,7 +115,7 @@ inline void
std::string swId = path.filename();
if (swId.empty())
{
- messages::internalError(aResp->res);
+ messages::internalError(asyncResp->res);
BMCWEB_LOG_ERROR << "Invalid software ID";
return;
@@ -135,7 +135,7 @@ inline void
sdbusplus::asio::getAllProperties(
*crow::connections::systemBus, obj.second[0].first,
obj.first, "xyz.openbmc_project.Software.Version",
- [aResp, swId, runningImage, swVersionPurpose,
+ [asyncResp, swId, runningImage, swVersionPurpose,
activeVersionPropName, populateLinkToImages](
const boost::system::error_code& ec3,
const dbus::utility::DBusPropertiesMap&
@@ -152,7 +152,7 @@ inline void
{
return;
}
- messages::internalError(aResp->res);
+ messages::internalError(asyncResp->res);
return;
}
// example propertiesList
@@ -169,13 +169,13 @@ inline void
if (!success)
{
- messages::internalError(aResp->res);
+ messages::internalError(asyncResp->res);
return;
}
if (version == nullptr || version->empty())
{
- messages::internalError(aResp->res);
+ messages::internalError(asyncResp->res);
return;
}
if (swInvPurpose == nullptr ||
@@ -192,7 +192,7 @@ inline void
if (populateLinkToImages)
{
nlohmann::json& softwareImageMembers =
- aResp->res.jsonValue["Links"]["SoftwareImages"];
+ asyncResp->res.jsonValue["Links"]["SoftwareImages"];
// Firmware images are at
// /redfish/v1/UpdateService/FirmwareInventory/<Id>
// e.g. .../FirmwareInventory/82d3ec86
@@ -201,7 +201,7 @@ inline void
"/redfish/v1/UpdateService/FirmwareInventory/{}",
swId);
softwareImageMembers.emplace_back(std::move(member));
- aResp->res
+ asyncResp->res
.jsonValue["Links"]["SoftwareImages@odata.count"] =
softwareImageMembers.size();
@@ -212,14 +212,15 @@ inline void
"/redfish/v1/UpdateService/FirmwareInventory/{}",
swId);
// Create the link to the running image
- aResp->res
+ asyncResp->res
.jsonValue["Links"]["ActiveSoftwareImage"] =
std::move(runningMember);
}
}
if (!activeVersionPropName.empty() && runningImage)
{
- aResp->res.jsonValue[activeVersionPropName] = *version;
+ asyncResp->res.jsonValue[activeVersionPropName] =
+ *version;
}
});
}
@@ -286,7 +287,7 @@ inline std::string getRedfishSwHealth(const std::string& swState)
* This function will put the appropriate Redfish state of the input
* software id to ["Status"]["State"] within the json response
*
- * @param[i,o] aResp Async response object
+ * @param[i,o] asyncResp Async response object
* @param[i] swId The software ID to get status for
* @param[i] dbusSvc The dbus service implementing the software object
*