Skip to content

Commit 3b1f49d

Browse files
makunterrygaborigloi
authored andcommitted
CA-227807: Internal Error on uploading unsigned Dundee hotfix
Signed-off-by: kun ma <[email protected]>
1 parent faa87b3 commit 3b1f49d

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

ocaml/xapi/xapi_pool_patch.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ let pool_patch_upload_handler (req: Http.Request.t) s _ =
6565
Db.Task.set_result ~__context ~self:(Context.get_task_id __context) ~value:(Ref.string_of patch);
6666
TaskHelper.complete ~__context None
6767
with e ->
68+
Client.VDI.destroy rpc session_id vdi;
6869
TaskHelper.failed ~__context e
6970
end
7071
| None ->

ocaml/xapi/xapi_pool_update.ml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,19 @@ let detach ~__context ~self =
144144
detach_helper ~__context ~uuid ~vdi
145145

146146
let with_api_errors f x =
147+
let errinfo = "Please upload a valid package." in
147148
try f x
148149
with
149150
| Smint.Command_failed(ret, status, stdout_log, stderr_log)
150151
| Smint.Command_killed(ret, status, stdout_log, stderr_log) ->
151152
let msg = Printf.sprintf "Smint.Command_{failed,killed} ret = %d; status = %s; stdout = %s; stderr = %s"
152153
ret status stdout_log stderr_log in
153-
raise (Api_errors.Server_error (Api_errors.internal_error, [msg]))
154+
error "%s" msg;
155+
raise (Api_errors.Server_error (Api_errors.invalid_update, [errinfo]))
156+
| e ->
157+
let msg = ExnHelper.string_of_exn e in
158+
error "%s" msg;
159+
raise (Api_errors.Server_error (Api_errors.invalid_update, [errinfo]))
154160

155161
(* yum confif example
156162
[main]

0 commit comments

Comments
 (0)