Fixed set & reset parser no argument handling

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


[ROCm/amdsmi commit: 5405615062]
このコミットが含まれているのは:
Maisam Arif
2023-10-16 06:24:42 -05:00
committed by Galantsev, Dmitrii
コミット 49a797f36e
3個のファイルの変更、55行の追加、22行の削除
+19
ファイルの表示
@@ -61,6 +61,7 @@ def _get_error_message(error_code):
return AMDSMI_ERROR_MESSAGES[abs(error_code)]
return "Generic error"
class AmdSmiException(Exception):
def __init__(self):
self.json_message = {}
@@ -125,6 +126,7 @@ class AmdSmiDeviceNotFoundException(AmdSmiException):
self.csv_message = f"error,code\n{common_message}, {self.value}"
self.stdout_message = f"{common_message} Error code: {self.value}"
class AmdSmiInvalidFilePathException(AmdSmiException):
def __init__(self, command, outputformat):
super().__init__()
@@ -184,6 +186,22 @@ class AmdSmiParameterNotSupportedException(AmdSmiException):
self.csv_message = f"error,code\n{common_message}, {self.value}"
self.stdout_message = f"{common_message} Error code: {self.value}"
class AmdSmiRequiredCommandException(AmdSmiException):
def __init__(self, command, outputformat):
super().__init__()
self.value = -9
self.command = command
self.output_format = outputformat
common_message = f"Command '{self.command}' requires a target argument. Run '--help' for more info."
self.json_message["error"] = common_message
self.json_message["code"] = self.value
self.csv_message = f"error,code\n{common_message}, {self.value}"
self.stdout_message = f"{common_message} Error code: {self.value}"
class AmdSmiUnknownErrorException(AmdSmiException):
def __init__(self, command, outputformat):
super().__init__()
@@ -198,6 +216,7 @@ class AmdSmiUnknownErrorException(AmdSmiException):
self.csv_message = f"error,code\n{common_message}, {self.value}"
self.stdout_message = f"{common_message} Error code: {self.value}"
class AmdSmiAMDSMIErrorException(AmdSmiException):
def __init__(self, outputformat, error_code):
super().__init__()