SWDEV-446724 - Version command human readable output file format fix

Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Change-Id: I94de5b03355b503ade307f2a3881acd07266d6c7


[ROCm/amdsmi commit: 943c74b6ef]
Этот коммит содержится в:
Maisam Arif
2024-06-24 10:35:34 -05:00
родитель 6cefd4bc36
Коммит 4d4ccf4bde
2 изменённых файлов: 10 добавлений и 4 удалений
+9 -3
Просмотреть файл
@@ -115,9 +115,15 @@ class AMDSMICommands():
self.logger.output['rocm_version'] = f'{rocm_version_str}'
if self.logger.is_human_readable_format():
print(f'AMDSMI Tool: {__version__} | '\
f'AMDSMI Library version: {amdsmi_lib_version_str} | ' \
f'ROCm version: {rocm_version_str}')
human_readable_output = f"AMDSMI Tool: {__version__} | " \
f"AMDSMI Library version: {amdsmi_lib_version_str} | " \
f"ROCm version: {rocm_version_str}"
# Custom human readable handling for version
if self.logger.destination == 'stdout':
print(human_readable_output)
else:
with self.logger.destination.open('a') as output_file:
output_file.write(human_readable_output + '\n')
elif self.logger.is_json_format() or self.logger.is_csv_format():
self.logger.print_output()
+1 -1
Просмотреть файл
@@ -465,7 +465,7 @@ class AMDSMILogger():
self._print_tabular_output(multiple_device_enabled=multiple_device_enabled, watching_output=watching_output)
else:
self._print_human_readable_output(multiple_device_enabled=multiple_device_enabled,
watching_output=watching_output)
watching_output=watching_output)
def _print_json_output(self, multiple_device_enabled=False, watching_output=False):