summaryrefslogtreecommitdiff
path: root/redfish-core/lib
diff options
context:
space:
mode:
authorGeorge Liu <liuxiwei@inspur.com>2021-11-17 12:43:45 +0300
committerEd Tanous <ed@tanous.net>2021-11-18 20:41:47 +0300
commit997093eb732dc889bd76f7aaa65e16a2aa4d7224 (patch)
treec4144eb851af0a26856bfb0e5fba53c46f6bc92a /redfish-core/lib
parent7adb85ac3eafe6a0a63506e6d78d487581c69ded (diff)
downloadbmcweb-997093eb732dc889bd76f7aaa65e16a2aa4d7224.tar.xz
chassis: Remove boost::ends_with method
The boost::ends_with method should be replaced with sdbusplus::message::object_path. Tested: curl -k https://$bmc/redfish/v1/Chassis/chassis { "@odata.id": "/redfish/v1/Chassis/chassis", "@odata.type": "#Chassis.v1_14_0.Chassis", "Actions": { "#Chassis.Reset": { "@Redfish.ActionInfo": "/redfish/v1/Chassis/chassis/ResetActionInfo", "target": "/redfish/v1/Chassis/chassis/Actions/Chassis.Reset" } }, "ChassisType": "RackMount", "Id": "chassis", "Links": { "ComputerSystems": [ { "@odata.id": "/redfish/v1/Systems/system" } ], "ManagedBy": [ { "@odata.id": "/redfish/v1/Managers/bmc" } ] }, "Manufacturer": "", "Model": "23", "Name": "chassis", "PCIeDevices": { "@odata.id": "/redfish/v1/Systems/system/PCIeDevices" }, "PartNumber": "", "Power": { "@odata.id": "/redfish/v1/Chassis/chassis/Power" }, "PowerState": "Off", "Sensors": { "@odata.id": "/redfish/v1/Chassis/chassis/Sensors" }, "SerialNumber": "", "Status": { "Health": "OK", "HealthRollup": "OK", "State": "StandbyOffline" }, "Thermal": { "@odata.id": "/redfish/v1/Chassis/chassis/Thermal" } } curl -k https://$bmc/redfish/v1/Chassis/chassis15363 { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The requested resource of type #Chassis.v1_14_0.Chassis named chassis15363 was not found.", "MessageArgs": [ "#Chassis.v1_14_0.Chassis", "chassis15363" ], "MessageId": "Base.1.8.1.ResourceNotFound", "MessageSeverity": "Critical", "Resolution": "Provide a valid resource identifier and resubmit the request." } ], "code": "Base.1.8.1.ResourceNotFound", "message": "The requested resource of type #Chassis.v1_14_0.Chassis named chassis15363 was not found." } } Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: Ieb9e9b02f1d66529e237815610365c33d7d8a079
Diffstat (limited to 'redfish-core/lib')
-rw-r--r--redfish-core/lib/chassis.hpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/redfish-core/lib/chassis.hpp b/redfish-core/lib/chassis.hpp
index c625b4b460..745f5af768 100644
--- a/redfish-core/lib/chassis.hpp
+++ b/redfish-core/lib/chassis.hpp
@@ -276,7 +276,8 @@ inline void requestRoutesChassis(App& app)
std::pair<std::string, std::vector<std::string>>>&
connectionNames = object.second;
- if (!boost::ends_with(path, chassisId))
+ sdbusplus::message::object_path objPath(path);
+ if (objPath.filename() != chassisId)
{
continue;
}
@@ -544,7 +545,8 @@ inline void requestRoutesChassis(App& app)
std::pair<std::string, std::vector<std::string>>>&
connectionNames = object.second;
- if (!boost::ends_with(path, chassisId))
+ sdbusplus::message::object_path objPath(path);
+ if (objPath.filename() != chassisId)
{
continue;
}