From 323ebacde0da4dcf9254301f48463343b6c25116 Mon Sep 17 00:00:00 2001 From: Charis Poag Date: Mon, 9 Dec 2024 09:43:03 -0600 Subject: [PATCH] Fix amd-smi firmware not printing YAML-like dictionary correctly List string should take into account dictionary value types Change-Id: Icc08288cb0007d43eacd1aff6d44c40a84ea9448 Signed-off-by: Charis Poag [ROCm/amdsmi commit: 57f45954b723b18c956e2050a1b397cb2b31f059] --- projects/amdsmi/amdsmi_cli/amdsmi_logger.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/projects/amdsmi/amdsmi_cli/amdsmi_logger.py b/projects/amdsmi/amdsmi_cli/amdsmi_logger.py index b776bd5450..f967910f7e 100644 --- a/projects/amdsmi/amdsmi_cli/amdsmi_logger.py +++ b/projects/amdsmi/amdsmi_cli/amdsmi_logger.py @@ -258,7 +258,10 @@ class AMDSMILogger(): elif isinstance(value, list): yaml_string += " " * indent + f"{key}:\n" for item in value: - yaml_string += " " * (indent + 1) + f"- {item}\n" + if isinstance(item, dict): + yaml_string += self.custom_dump(item, indent + 1) + else: # If the list is not a dictionary, print it as a string + yaml_string += " " * (indent + 1) + f"- {item}\n" else: yaml_string += " " * indent + f"{key}: {value}\n" return yaml_string