Skip to content

Commit f5cacaa

Browse files
committed
Refactor boost::urls usage in system collection handler
This is a simple refactor in handleComputerSystemCollection to use boost::urls::format instead of the crow util fucntion appendUrlPieces. Tested: Query the route with curl and check if it still responds with a valid collection. Change-Id: If9c5f6dc8672c00b94db296d5968f756598a05e7 Signed-off-by: Oliver Brewka <oliver.brewka@9elements.com>
1 parent 675637f commit f5cacaa

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

redfish-core/include/utils/systems_utils.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,9 @@ inline void handleSystemCollectionMembers(
8787

8888
for (const std::string& systemName : pathNames)
8989
{
90-
boost::urls::url url("/redfish/v1/Systems");
91-
crow::utility::appendUrlPieces(url, systemName);
9290
nlohmann::json::object_t member;
93-
member["@odata.id"] = std::move(url);
91+
member["@odata.id"] =
92+
boost::urls::format("/redfish/v1/Systems/{}", systemName);
9493
membersArray.emplace_back(std::move(member));
9594
}
9695
asyncResp->res.jsonValue["Members@odata.count"] = membersArray.size();

0 commit comments

Comments
 (0)