From 8cd9ee408076561cd877741a2c54f6b01ef79aea Mon Sep 17 00:00:00 2001 From: Mike Raineri Date: Thu, 11 Jul 2024 15:24:01 -0400 Subject: [PATCH] Fixed 'list' commands for 'rf_power_equipment.py' and 'rf_thermal_equipment.py' to handle cases where properties are not supported or null Signed-off-by: Mike Raineri --- redfish_utilities/power_equipment.py | 10 +++++----- redfish_utilities/thermal_equipment.py | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/redfish_utilities/power_equipment.py b/redfish_utilities/power_equipment.py index c4d1e66..a99ddc3 100644 --- a/redfish_utilities/power_equipment.py +++ b/redfish_utilities/power_equipment.py @@ -263,11 +263,11 @@ def print_power_equipment_summary(power_equipment_summary): for equipment in power_equipment_summary[equipment_type]: print( summary_line_format.format( - equipment["Id"], - equipment["Model"], - equipment["SerialNumber"], - equipment["State"], - equipment["Health"], + equipment["Id"] if equipment["Id"] else "", + equipment["Model"] if equipment["Model"] else "", + equipment["SerialNumber"] if equipment["SerialNumber"] else "", + equipment["State"] if equipment["State"] else "", + equipment["Health"] if equipment["Health"] else "", ) ) print("") diff --git a/redfish_utilities/thermal_equipment.py b/redfish_utilities/thermal_equipment.py index 664334d..4efb64f 100644 --- a/redfish_utilities/thermal_equipment.py +++ b/redfish_utilities/thermal_equipment.py @@ -162,11 +162,11 @@ def print_thermal_equipment_summary(thermal_equipment_summary): for equipment in thermal_equipment_summary[equipment_type]: print( summary_line_format.format( - equipment["Id"], - equipment["Model"], - equipment["SerialNumber"], - equipment["State"], - equipment["Health"], + equipment["Id"] if equipment["Id"] else "", + equipment["Model"] if equipment["Model"] else "", + equipment["SerialNumber"] if equipment["SerialNumber"] else "", + equipment["State"] if equipment["State"] else "", + equipment["Health"] if equipment["Health"] else "", ) ) print("")