Better support for dnf5 in Fedora 41/42#67975
Conversation
|
Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey. There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar. |
twangboy
left a comment
There was a problem hiding this comment.
Please create a changelog and write a test for this.
|
Changelog entry added. I looked to add a test to test/pytest/unit/modules/test_yumpkg.py, but on running (without any changes):
I don't have a test environment setup for salt development, and don't intend to be doing further salt development, so my incentive to debug why this didn't Just Work is quite low :( Sorry. |
twangboy
left a comment
There was a problem hiding this comment.
Could you write a simple test here, or ensure that existing tests cover these changes
|
Please see my previous comment. I've tried to build a test, but I'm failing right now to even get a basic test environment setup. |
|
@gregoster Sorry, there are more conflicts that need to be addressed. |
'grouplist' and 'groupinfo' are each now two words. 'group' and 'group-id' have been replaced with 'name' and 'id', so check for those too.
The dnf5 'group info' output differs from the dnf 'groupinfo' output. In particular, a package name is now also listed on the first line of each section. Need to also strip leading spaces from lines.
dnf5 group_list-specific test was missing, but these tests should only be run against dnf5, as yum/dnf provide different output for 'grouplist' and 'groupinfo'.
dnf5 'group list' output needs to be handed differently than yum/dnf 'grouplist' output. Also condition on _yum() so we don't break 'grouplist' and 'groupinfo' on systems using yum/dnf.
the case of the package name when adding it to the list.
- test_67975_dnf5_group_info: add missing "type": "package group" key to
the expected dict (the new elif "name" in g_info branch populates it).
- yumpkg group_list/group_info: replace `_yum() in ("dnf5")`,
`pkg_id not in ("id")`, and `pkg_installed in ("yes")` with `==`/`!=`
comparisons. These were substring-in-string checks (no trailing comma
on a single-string tuple); they worked for exact equality but would
have accepted any single character in those strings as a match.
- yumpkg group_info: drop stray space inside `re.match( r"..." )` so
black is happy.
Co-authored-by: Greg Oster <oster@fween.ca>
'grouplist' and 'groupinfo' are each now two words. 'group' and 'group-id' have been replaced with 'name' and 'id', so check for those too.
What does this PR do?
Improve support for installing via groups with dnf5 on Fedora 41/42. Issue found when attempting to run salt 3007 on Fedora 42. Problem also exists in master/main, so starting there.
What issues does this PR fix or reference?
Fixes salt failing on a Fedora 41/42 install when (e.g.) installing KDE Fonts via a group:
The name of the group doesn't seem to matter -- all groups fail, as 'groupinfo' and 'grouplist' have been deprecated since dnf5 as shipped with Fedora 41.
Merge requirements satisfied?
[NOTICE] Bug fixes or features added to Salt require tests.
Commits signed with GPG?
No