Fix PowerSupply GET error
The commit 3e42a3290ae35f05b30fa1863f44e95845577420[1] mistakenly
handled a check of then given powersupply id, and caused Redfish Service
Validator error.
Tested:
- Verify GET
```
curl -k https://${bmc}/redfish/v1/Chassis/chassis/PowerSubsystem/PowerSupplies/powersupply0
```
- Redfish Service Validator on PowerSupplies passes
```
python3 RedfishServiceValidator.py --auth Session -i https://${bmc} -u ${user} -p ${password} \
--payload Tree /redfish/v1/Chassis/chassis/PowerSubsystem/PowerSupplies
```
[1] https://github.com/openbmc/bmcweb/commit/3e42a3290ae35f05b30fa1863f44e95845577420
Change-Id: I9abfadc5f1ad5a0fd05e596190678aa804259045
Signed-off-by: Myung Bae <myungbae@us.ibm.com>
diff --git a/redfish-core/lib/power_supply.hpp b/redfish-core/lib/power_supply.hpp
index f934a3b..f085272 100644
--- a/redfish-core/lib/power_supply.hpp
+++ b/redfish-core/lib/power_supply.hpp
@@ -161,7 +161,7 @@
for (const auto& [objectPath, service] : subtree)
{
sdbusplus::message::object_path path(objectPath);
- if (path == powerSupplyId)
+ if (path.filename() == powerSupplyId)
{
callback(path, service.begin()->first);
return;