File tree Expand file tree Collapse file tree 3 files changed +11
-0
lines changed
Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -571,3 +571,11 @@ let name_of_uuid uuid = Printf.sprintf "%s.pem" uuid
571571
572572let db_type_of_category category =
573573 match category with `Root -> `ca | `Pinned -> `pinned
574+
575+ let cleanup_all_trusted () =
576+ let ( let* ) l f = List.iter f l in
577+ let* kind = all_trusted_kinds in
578+ let* store = trusted_store_locations kind in
579+ Unixext.rm_rec ~rm_top:false store.cert_dir ;
580+ Unixext.unlink_safe (store.bundle_dir // store.bundle_name) ;
581+ ()
Original file line number Diff line number Diff line change @@ -70,6 +70,8 @@ val sync_all_hosts : __context:Context.t -> API.ref_host list -> unit
7070
7171val db_type_of_category : [`Root | `Pinned ] -> [`ca | `pinned ]
7272
73+ val cleanup_all_trusted : unit -> unit
74+
7375(* Database manipulation *)
7476
7577module Db_util : sig
Original file line number Diff line number Diff line change @@ -2385,6 +2385,7 @@ let eject_self ~__context ~host =
23852385 Unixext. unlink_safe Xapi_globs. db_temporary_restore_path ;
23862386 Unixext. unlink_safe Db_globs. ha_metadata_db ;
23872387 Unixext. unlink_safe Db_globs. gen_metadata_db ;
2388+ Certificates. cleanup_all_trusted () ;
23882389 (* If we've got local storage, remove it *)
23892390 if Helpers. local_storage_exists () then (
23902391 ignore
You can’t perform that action at this time.
0 commit comments