-
Notifications
You must be signed in to change notification settings - Fork 293
CA-419238: Remove /etc/dnf/repos.override.d/99-config_manager.repo after using #6738
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CA-419238: Remove /etc/dnf/repos.override.d/99-config_manager.repo after using #6738
Conversation
ocaml/xapi/xapi_globs.ml
Outdated
|
|
||
| let yum_repos_config_dir = ref "/etc/yum.repos.d" | ||
|
|
||
| let dnf_repo_config_file = ref "/etc/dnf/repos.override.d/99-config_manager.repo" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this a ref when there is no code to modify it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just do same as others e.g. /etc/yum.repos.d
ocaml/xapi/xapi_globs.ml
Outdated
|
|
||
| let yum_repos_config_dir = ref "/etc/yum.repos.d" | ||
|
|
||
| let dnf_repo_config_file = ref "/etc/dnf/repos.override.d/99-config_manager.repo" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @DeliZhangX
May I please know why the password will be written into this file?
It is done by dnf automatically? Its predecessor yum will write into the same repo config file. So the password will be removed with the write_initial_yum_config in the final block as the comment describes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be with the repo name like remote-<UUID>.repo? Why now it is /etc/dnf/repos.override.d/99-config_manager.repo?
Hmm. This seems the behaviour of the dnf config-manager.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the dnf5's behaviour.
Could you please remove the file in remove_repo_conf_file as well. This is just to ensure the configurations for the repo is cleaned up completely in any case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the dnf5's behaviour. Could you please remove the file in
remove_repo_conf_fileas well. This is just to ensure the configurations for the repo is cleaned up completely in any case.
I tried to investigate, while it looks not easy to do, as dnf config-manager writes all repos configurations to single one file by default /etc/dnf/repos.override.d/99-config_manager.repo, to remove a repo we have to unsetopt all config of the repo from it. The possible solution could be one of below:
- Do not use
dnf config-managerbut just reusewrite_yum_configetc to manager repos - Write separate repo files under
/etc/dnf/repos.override.d/(while this seems duplicate to yum's)
My commit is just to fix the issue, improving toolstack feature beyond my goal. So I suggest create new ticket to let Toolstack CoP implement in future.
ocaml/xapi/repository.ml
Outdated
| * this should be ok. | ||
| *) | ||
| write_initial_yum_config ~binary_url | ||
| if Pkgs.manager = Yum then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be:
match Pkgs.manager with
| Yum ->
write_initial_yum_config ~binary_url
| Dnf ->
Unixext.unlink_safe !Xapi_globs.dnf_repo_config_file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, will fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
79d004f to
1a549a9
Compare
…ter 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>
1a549a9 to
b8f8b7b
Compare
This file is generated by dnf config manager and contains proxy password, needs to be removed after using.