Skip to content

Commit

Permalink
CA-396540: Update bundle syncing failure description
Browse files Browse the repository at this point in the history
Update bundle syncing failure description to:
Syncing with bundle repository failed.

Signed-off-by: Bengang Yuan <bengang.yuan@cloud.com>
  • Loading branch information
BengangY committed Aug 2, 2024
1 parent 77333ee commit e1b2712
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions ocaml/idl/datamodel_errors.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1927,6 +1927,8 @@ let _ =
() ;
error Api_errors.reposync_failed []
~doc:"Syncing with remote YUM repository failed." () ;
error Api_errors.bundle_sync_failed []
~doc:"Syncing with bundle repository failed." () ;
error Api_errors.invalid_repomd_xml [] ~doc:"The repomd.xml is invalid." () ;
error Api_errors.invalid_updateinfo_xml []
~doc:"The updateinfo.xml is invalid." () ;
Expand Down
2 changes: 2 additions & 0 deletions ocaml/xapi-consts/api_errors.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1338,6 +1338,8 @@ let sync_bundle_in_progress = add_error "SYNC_BUNDLE_IN_PROGRESS"

let reposync_failed = add_error "REPOSYNC_FAILED"

let bundle_sync_failed = add_error "BUNDLE_SYNC_FAILED"

let createrepo_failed = add_error "CREATEREPO_FAILED"

let invalid_updateinfo_xml = add_error "INVALID_UPDATEINFO_XML"
Expand Down
9 changes: 6 additions & 3 deletions ocaml/xapi/xapi_pool.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3790,9 +3790,12 @@ let put_bundle_handler (req : Request.t) s _ =
TaskHelper.set_progress ~__context 0.8 ;
finally
(fun () ->
sync_repos ~__context ~self:pool ~repos:[repo] ~force:true
~token:"" ~token_id:""
|> ignore
try
sync_repos ~__context ~self:pool ~repos:[repo] ~force:true
~token:"" ~token_id:""
|> ignore
with _ ->
raise Api_errors.(Server_error (bundle_sync_failed, []))
)
(fun () -> Unixext.rm_rec !Xapi_globs.bundle_repository_dir)
| Error e ->
Expand Down

0 comments on commit e1b2712

Please sign in to comment.