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 35da761
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
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
4 changes: 3 additions & 1 deletion ocaml/xapi/xapi_pool.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3434,7 +3434,9 @@ let sync_repos ~__context ~self ~repos ~force ~token ~token_id =
repos
|> List.iter (fun repo ->
if force then cleanup_pool_repo ~__context ~self:repo ;
sync ~__context ~self:repo ~token ~token_id ;
( try sync ~__context ~self:repo ~token ~token_id
with _ -> raise Api_errors.(Server_error (bundle_sync_failed, []))
) ;
(* Dnf sync all the metadata including updateinfo,
* Thus no need to re-create pool repository *)
if Pkgs.manager = Yum then
Expand Down

0 comments on commit 35da761

Please sign in to comment.