Skip to content
Commit bbf372a6 authored by Lakshmi Yadlapati's avatar Lakshmi Yadlapati
Browse files

Fix invalid PCIeType in pcie_slots

When the Generation field of a PCIeSlot object in D-Bus is set to
"xyz.openbmc_project.Inventory.Item.PCIeSlot.Generations.Unknown",
pcie_slots was returning an invalid PCIeType of "false". This caused
the Redfish validator to fail. To resolve this, the code has been
updated to not return the PCIeType if the Generation field is empty
or unknown.

Tested: Validator passed
'''
busctl get-property -j xyz.openbmc_project.Inventory.Manager \
/xyz/openbmc_project/inventory/system/chassis/motherboard/disk_backplane0/nvme0 \
xyz.openbmc_project.Inventory.Item.PCIeSlot Generation
{
        "type" : "s",
        "data" : "xyz.openbmc_project.Inventory.Item.PCIeSlot.Generations.Unknown"
}

curl -k https://$bmc/redfish/v1/Chassis/chassis/PCIeSlots
{
  "@odata.id": "/redfish/v1/Chassis/chassis/PCIeSlots",
  "@odata.type": "#PCIeSlots.v1_4_1.PCIeSlots",
  "Id": "1",
  "Name": "PCIe Slot Information",
  "Slots": [
    {
      "HotPluggable": false,
      "Lanes": 0,
      "SlotType": "U2"
    },
.....
}

busctl set-property  xyz.openbmc_project.Inventory.Manager \
/xyz/openbmc_project/inventory/system/chassis/motherboard/disk_backplane0/nvme0 \
xyz.openbmc_project.Inventory.Item.PCIeSlot Generation s \
xyz.openbmc_project.Inventory.Item.PCIeSlot.Generations.Gen1

curl -k https://$bmc/redfish/v1/Chassis/chassis/PCIeSlots


{
  "@odata.id": "/redfish/v1/Chassis/chassis/PCIeSlots",
  "@odata.type": "#PCIeSlots.v1_4_1.PCIeSlots",
  "Id": "1",
  "Name": "PCIe Slot Information",
  "Slots": [
    {
      "HotPluggable": false,
      "Lanes": 0,
      "PCIeType": "Gen1",
      "SlotType": "U2"
    },
....
}
'''

Change-Id: I143ce7e90cf24447a667a09d946e42f00c091a64
Signed-off-by: default avatarLakshmi Yadlapati <lakshmiy@us.ibm.com>
parent c6bb3285
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment