Skip to content

Commit 41cfd70

Browse files
committed
fix err return values
Signed-off-by: Ben Levi <belevi@nvidia.com>
1 parent 35fded9 commit 41cfd70

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sonic_platform_base/redfish_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,13 +1139,13 @@ def redfish_api_update_firmware(self, fw_image, fw_ids = None, \
11391139
force_update=force_update)
11401140
ret, _, response, error_msg = self.exec_curl_cmd(cmd)
11411141
if (ret != RedfishClient.ERR_CODE_OK):
1142-
return (ret, f'Error: {error_msg}')
1142+
return (ret, f'Error: {error_msg}', [])
11431143

11441144
try:
11451145
json_response = json.loads(response)
11461146
except Exception as e:
11471147
msg = 'Error: Invalid JSON format'
1148-
return (RedfishClient.ERR_CODE_INVALID_JSON_FORMAT, msg)
1148+
return (RedfishClient.ERR_CODE_INVALID_JSON_FORMAT, msg, [])
11491149

11501150
# Retrieve task id from response
11511151
task_id = ''
@@ -1157,14 +1157,14 @@ def redfish_api_update_firmware(self, fw_image, fw_ids = None, \
11571157
else:
11581158
ret = RedfishClient.ERR_CODE_UNEXPECTED_RESPONSE
11591159
err_msg = "Missing 'message' field"
1160-
return (ret, f'Error: {err_msg}')
1160+
return (ret, f'Error: {err_msg}', [])
11611161
elif 'TaskStatus' in json_response:
11621162
status = json_response['TaskStatus']
11631163
if status == 'OK':
11641164
task_id = json_response['Id']
11651165
else:
11661166
ret = RedfishClient.ERR_CODE_GENERIC_ERROR
1167-
return (ret, f'Error: Return status is {status}')
1167+
return (ret, f'Error: Return status is {status}', [])
11681168

11691169
# Wait for completion
11701170
result = self.__wait_task_completion(task_id, timeout, progress_callback)

0 commit comments

Comments
 (0)