bmcweb: Fix PartLocationContext for Chassis
I wrongly assumed that an object cannot have both chassis interface
and connector interface which warthog object does. So
PartLocationContext was being derived twice. In this changeset i am
making sure that /containedby association is explored only when chassis
interface is detected after exploring all interfaces including connector
Tested:
```
root@jkeju13-nfd01:~# wget -qO- localhost:80/redfish/v1/Chassis/warthog_1
{
"@odata.id": "/redfish/v1/Chassis/warthog_1",
"@odata.type": "#Chassis.v1_17_0.Chassis",
"Assembly": {
"@odata.id": "/redfish/v1/Chassis/warthog_1/Assembly"
},
"ChassisType": "RackMount",
"Drives": {
"@odata.id": "/redfish/v1/Chassis/warthog_1/Drives"
},
"EnvironmentMetrics": {
"@odata.id": "/redfish/v1/Chassis/warthog_1/EnvironmentMetrics"
},
"Id": "warthog_1",
"Links": {
"ComputerSystems": [
{
"@odata.id": "/redfish/v1/Systems/system"
}
],
"ContainedBy": {
"@odata.id": "/redfish/v1/Chassis/ioadapter_x8x8_1"
},
"ManagedBy": [
{
"@odata.id": "/redfish/v1/Managers/bmc"
}
],
"Storage": [
{
"@odata.id": "/redfish/v1/Systems/system/Storage/warthog_storage_1"
}
],
"Storage@odata.count": 1
},
"Location": {
"PartLocation": {
"LocationType": "Slot",
"ServiceLabel": "IO0"
},
"PartLocationContext": "PE2"
},
"Manufacturer": "Kingston",
"Model": "Warthog",
"Name": "warthog_1",
"PCIeDevices": {
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices"
},
"PartNumber": "KW049419-67901",
"Power": {
"@odata.id": "/redfish/v1/Chassis/warthog_1/Power"
},
"PowerState": "On",
"PowerSubsystem": {
"@odata.id": "/redfish/v1/Chassis/warthog_1/PowerSubsystem"
},
"Sensors": {
"@odata.id": "/redfish/v1/Chassis/warthog_1/Sensors"
},
"SerialNumber": "20819562",
"Status": {
"Health": "OK",
"HealthRollup": "OK",
"State": "Enabled"
},
"Thermal": {
"@odata.id": "/redfish/v1/Chassis/warthog_1/Thermal"
},
"ThermalSubsystem": {
"@odata.id": "/redfish/v1/Chassis/warthog_1/ThermalSubsystem"
}
}
```
Google-Bug-Id: 283353012
Change-Id: I5b41e172cdbb793ba8e2c5d354037485f4c1b1b4
Signed-off-by: Rahul Kapoor <rahulkpr@google.com>
3 files changed