|
Create a reusable utility function getPrettyName() in
utils/name_utils.hpp that can retrieve the PrettyName property from the
D-Bus xyz.openbmc_project.Inventory.Item interface.
The function accepts a JSON pointer parameter, allowing it to set the
PrettyName at any location in the response (e.g. within arrays or nested
objects). This makes it reusable across multiple components (Drives,
Processors, Memory, Chassis, etc.).
Relates-to: https://github.com/openbmc/bmcweb/issues/204
Tested:
- Built bmcweb with meson/ninja successfully
- Tested with https://gerrit.openbmc.org/c/openbmc/bmcweb/+/90364 and
verified that PrettyName appears in the response
- Falls back to default name when PrettyName is empty
Change-Id: Iebd31b523797152b0e8e7ea8852f86b292fb5f55
Signed-off-by: Akash Arunkumar <mirrorghost007@gmail.com>
Signed-off-by: Justin Nguyen <justinnanguyen@gmail.com>
|