drive: cleanup recent errors
There were two new errors found the drives implementation that was
recently implemented.
Tested:
wget -qO- http://localhost:80/redfish/v1/Chassis/DC_SCM/Drives
{
"@odata.id": "/redfish/v1/Chassis/DC_SCM/Drives",
"@odata.type": "#DriveCollection.DriveCollection",
"Members": [
{
"@odata.id": "/redfish/v1/Chassis/DC_SCM/Drives/mmcblk0"
}
],
"Members@odata.count": 1,
"Name": "Drive Collection"
}
wget -qO- http://localhost:80/redfish/v1/Chassis/DC_SCM/Drives/mmcblk0
{
"@odata.id": "/redfish/v1/Chassis/DC_SCM/Drives/mmcblk0",
"CapacityBytes": 15634268160,
"Id": "mmcblk0",
"Links": {
"Chassis": "Enabled"
},
"Name": "mmcblk0",
"Status": {
"State": "Enabled"
}
}
Tested:
Redfish Validator Passed now.
Old Validator Failure
```
*** /redfish/v1/Chassis/chassis_0/Drives/drive_0
WARNING - /redfish/v1/Chassis/chassis_0/Drives/drive_0 @odata.id: Expected @odata.id to match URI link /redfish/v1/Chassis/Drives/drive_0
ERROR - URI /redfish/v1/Chassis/Drives/drive_0 does not match the following required URIs in Schema of Drive.v1_7_0.Drive
INFO - Type (Drive.v1_7_0.Drive), GET SUCCESS (time: 0:00:00.072884)
INFO - Attempt 1 of /redfish/v1/Chassis/chassis_0
INFO - Response Time for GET to /redfish/v1/Chassis/chassis_0: 0.253246079897508 seconds.
INFO - FAIL...
INFO - Metadata: Namespaces missing from $metadata: set()
INFO -
```
Current Output,
```
{
"@odata.id": "/redfish/v1/Chassis/chassis_0/Drives/drive_0",
"@odata.type": "#Drive.v1_7_0.Drive",
"Id": "drive_0",
"Links": {
"Chassis": {
"@odata.id": "/redfish/v1/Chassis/chassis_0"
}
},
...
}
```
Change-Id: I1af7704070dbf43c4e8b7768a052a2be4446b54c
Signed-off-by: John Edward Broadbent <jebr@google.com>
diff --git a/redfish-core/lib/chassis.hpp b/redfish-core/lib/chassis.hpp
index f1de38c..d6f9321 100644
--- a/redfish-core/lib/chassis.hpp
+++ b/redfish-core/lib/chassis.hpp
@@ -291,7 +291,7 @@
}
nlohmann::json reference;
- reference["odata.id"] = crow::utility::urlFromPieces(
+ reference["@odata.id"] = crow::utility::urlFromPieces(
"redfish", "v1", "Chassis", chassisId, "Drives");
asyncResp->res.jsonValue["Drives"] = std::move(reference);
});