From f797c6a6abe0917662ab6d742273b2831863eea4 Mon Sep 17 00:00:00 2001 From: Patrick Williams Date: Fri, 16 Jul 2021 12:29:59 -0500 Subject: treewide: inventory: switch ChassisType to future enum value Change Ie1a7c389edb6b7a048836a49283ceb62de51bba5 will be transitioning the 'Type' property in Inventory.Item.Chassis to an enumeration. In order to avoid crashing in PIM we need these default values in the starting YAML to be fully-qualified enumeration names that will match the values which will start in Ie1a7c. This code is safe to merge as is without any PDI or PIM changes. Prior to the PDI change, we must make a change to PIM that allows conversion automatic from string->enum, leveraging library interfaces available in sdbusplus. These will be submitted independently. I checked the codebase for usage of this string. It appears that the value is currently, effectively, write-only. There is code in bmcweb that fills in the equivalent Redfish value but currently just hard-codes the string 'RackMount'. Tested: Booted Witherspoon in a QEMU model with this change and proposed changes to sdbusplus + PIM. PIM no longer coredumps with the PDI change and yields an expected persistence file: ``` $ pwd /var/lib/phosphor-inventory-manager/xyz/openbmc_project/inventory/system/chassis $ cat xyz.openbmc_project.Inventory.Item.Chassis { "value0": { "cereal_class_version": 2, "Type": 3 } } ``` Signed-off-by: Patrick Williams Change-Id: Icaf9447f31ccdd945cdf74b3e017682e4aed686f --- .../recipes-phosphor/inventory/inventory-cleanup/inventory-cleanup.yaml | 2 +- .../recipes-phosphor/inventory/inventory-cleanup/inventory-cleanup.yaml | 2 +- .../inventory/inventory-cleanup/swift/inventory-cleanup.yaml | 2 +- .../inventory/inventory-cleanup/witherspoon/inventory-cleanup.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'meta-ibm') diff --git a/meta-ibm/meta-palmetto/recipes-phosphor/inventory/inventory-cleanup/inventory-cleanup.yaml b/meta-ibm/meta-palmetto/recipes-phosphor/inventory/inventory-cleanup/inventory-cleanup.yaml index 8fbc38162..0671e155e 100644 --- a/meta-ibm/meta-palmetto/recipes-phosphor/inventory/inventory-cleanup/inventory-cleanup.yaml +++ b/meta-ibm/meta-palmetto/recipes-phosphor/inventory/inventory-cleanup/inventory-cleanup.yaml @@ -12,5 +12,5 @@ events: /system/chassis: xyz.openbmc_project.Inventory.Item.Chassis: Type: - value: "RackMount" + value: "xyz.openbmc_project.Inventory.Item.Chassis.ChassisType.RackMount" type: string diff --git a/meta-ibm/meta-romulus/recipes-phosphor/inventory/inventory-cleanup/inventory-cleanup.yaml b/meta-ibm/meta-romulus/recipes-phosphor/inventory/inventory-cleanup/inventory-cleanup.yaml index 0f72008c7..08f35805c 100644 --- a/meta-ibm/meta-romulus/recipes-phosphor/inventory/inventory-cleanup/inventory-cleanup.yaml +++ b/meta-ibm/meta-romulus/recipes-phosphor/inventory/inventory-cleanup/inventory-cleanup.yaml @@ -12,5 +12,5 @@ events: /system/chassis: xyz.openbmc_project.Inventory.Item.Chassis: Type: - value: "RackMount" + value: "xyz.openbmc_project.Inventory.Item.Chassis.ChassisType.RackMount" type: string diff --git a/meta-ibm/recipes-phosphor/inventory/inventory-cleanup/swift/inventory-cleanup.yaml b/meta-ibm/recipes-phosphor/inventory/inventory-cleanup/swift/inventory-cleanup.yaml index a2ff9d177..f85adc3db 100644 --- a/meta-ibm/recipes-phosphor/inventory/inventory-cleanup/swift/inventory-cleanup.yaml +++ b/meta-ibm/recipes-phosphor/inventory/inventory-cleanup/swift/inventory-cleanup.yaml @@ -12,5 +12,5 @@ events: /system/chassis: xyz.openbmc_project.Inventory.Item.Chassis: Type: - value: "RackMount" + value: "xyz.openbmc_project.Inventory.Item.Chassis.ChassisType.RackMount" type: string diff --git a/meta-ibm/recipes-phosphor/inventory/inventory-cleanup/witherspoon/inventory-cleanup.yaml b/meta-ibm/recipes-phosphor/inventory/inventory-cleanup/witherspoon/inventory-cleanup.yaml index a363bda8d..e8be22f8a 100644 --- a/meta-ibm/recipes-phosphor/inventory/inventory-cleanup/witherspoon/inventory-cleanup.yaml +++ b/meta-ibm/recipes-phosphor/inventory/inventory-cleanup/witherspoon/inventory-cleanup.yaml @@ -47,5 +47,5 @@ events: /system/chassis: xyz.openbmc_project.Inventory.Item.Chassis: Type: - value: "RackMount" + value: "xyz.openbmc_project.Inventory.Item.Chassis.ChassisType.RackMount" type: string -- cgit v1.2.3