Skip to content

Commit b8f8b7b

Browse files
Deli ZhangDeliZhangX
authored andcommitted
CA-419238: Remove /etc/dnf/repos.override.d/99-config_manager.repo after using
This file is generated by dnf config manager and contains proxy password, needs to be removed after using. Signed-off-by: Deli Zhang <deli.zhang@cloud.com>
1 parent 73de328 commit b8f8b7b

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

ocaml/xapi/repository.ml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,11 @@ let sync ~__context ~self ~token ~token_id ~username ~password =
293293
* will always write_initial_yum_config every time before syncing repo,
294294
* this should be ok.
295295
*)
296-
write_initial_yum_config ~binary_url
296+
match Pkgs.manager with
297+
| Yum ->
298+
write_initial_yum_config ~binary_url
299+
| Dnf ->
300+
Unixext.unlink_safe !Xapi_globs.dnf_repo_config_file
297301
) ;
298302
(* The custom yum-utils will fully download repository metadata including
299303
* the repo gpg signature.

ocaml/xapi/xapi_globs.ml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -972,6 +972,9 @@ let pvsproxy_close_cache_vdi = ref "/opt/citrix/pvsproxy/close-cache-vdi.sh"
972972

973973
let yum_repos_config_dir = ref "/etc/yum.repos.d"
974974

975+
let dnf_repo_config_file =
976+
ref "/etc/dnf/repos.override.d/99-config_manager.repo"
977+
975978
let remote_repository_prefix = ref "remote"
976979

977980
let bundle_repository_prefix = ref "bundle"

0 commit comments

Comments
 (0)