Skip to content

Conversation

@DeliZhangX
Copy link
Contributor

This file is generated by dnf config manager and contains proxy password, needs to be removed after using.


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"
Copy link
Contributor

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?

Copy link
Contributor Author

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

@robhoes robhoes requested a review from minglumlu October 31, 2025 10:48

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"
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@minglumlu minglumlu Nov 3, 2025

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.

Copy link
Member

@minglumlu minglumlu Nov 3, 2025

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.

Copy link
Contributor Author

@DeliZhangX DeliZhangX Nov 4, 2025

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.

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-manager but just reuse write_yum_config etc 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.

* this should be ok.
*)
write_initial_yum_config ~binary_url
if Pkgs.manager = Yum then
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, will fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

@DeliZhangX DeliZhangX force-pushed the private/deliz/CA-419238 branch 2 times, most recently from 79d004f to 1a549a9 Compare November 4, 2025 08:52
…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>
@DeliZhangX DeliZhangX force-pushed the private/deliz/CA-419238 branch from 1a549a9 to b8f8b7b Compare November 4, 2025 09:40
@minglumlu minglumlu added this pull request to the merge queue Nov 5, 2025
Merged via the queue into xapi-project:master with commit 059f0b2 Nov 5, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants