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 <Charis.Poag@amd.com>
This commit is contained in:
Charis Poag committed 2024-12-11 10:48:43 -05:00
1 parent 2a1e2eed18
commit 57f45954b7
1 file changed
+4 -1
+4 -1
View File
@@ -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