[AMD-SMI] [SWDEV-572092] amd-smi does not redirect output to file when --json option is used. (#2389)

* Fix for amd-smi json file redirection is broken

Signed-off-by: yalmusaf_amdeng <Yazen.ALMusaffar@amd.com>

* merge branch develop into SWDEV-572092

Signed-off-by: yalmusaf_amdeng <Yazen.ALMusaffar@amd.com>

---------

Signed-off-by: yalmusaf_amdeng <Yazen.ALMusaffar@amd.com>
Šī revīzija ir iekļauta:
Yazen AL Musaffar
2026-01-28 13:54:44 -06:00
revīziju iesūtīja GitHub
vecāks a5ada1e6e3
revīzija 0c54f1d6f6
@@ -622,12 +622,11 @@ class AMDSMILogger():
combined_json["partition_profiles"] = self.store_partition_profiles_json_output
if self.store_partition_resources_json_output:
combined_json["partition_resources"] = self.store_partition_resources_json_output
if self.destination == 'stdout':
json_std_output = json.dumps(combined_json, indent=4)
print(json_std_output)
else:
with open(self.destination, 'w', encoding="utf-8") as output_file:
with self.destination.open('w', encoding="utf-8") as output_file:
json.dump(combined_json, output_file, indent=4)