Bug 1620324

Summary: Installing a group with dnf.base.group_install() doesn't mark the group as installed
Product: [Fedora] Fedora Reporter: Adam Miller <admiller>
Component: dnfAssignee: Daniel Mach <dmach>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 28CC: admiller, bfinger, dmach, ksrot, mblaha, packaging-team-maint, rpm-software-management, vmukhame
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1624820 (view as bug list) Environment:
Last Closed: 2019-03-02 16:00:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1624820    
Attachments:
Description Flags
install_group.py none

Description Adam Miller 2018-08-23 03:04:36 UTC
Created attachment 1478030 [details]
install_group.py

Description of problem:
When I install a group via the dnf API, it does not mark the group as installed but instead just installs the packages from the group.

Version-Release number of selected component (if applicable):
dnf-2.7.5-12.fc28.noarch

How reproducible:
Always


Steps to Reproduce:
1. Run the attached script install_group.py
2. Attempt to remove the group with the command 'dnf groupremove "Development Tools"'


Actual results:
$ cat /tmp/install_group.py
#!/usr/bin/python3

import dnf

base = dnf.Base()

conf = base.conf
conf.assumeyes = True
conf.read()

base.read_all_repos()
base.fill_sack(load_system_repo='auto')
base.read_comps()

group = base.comps.group_by_pattern("Development Tools")

base.group_install(group.id, dnf.const.GROUP_PACKAGE_TYPES)

base.resolve(allow_erasing=True)

print(base.transaction.install_set)

$ /tmp/install_group.py
{<hawkey.Package object id 13556, systemtap-3.3-1.fc28.x86_64, updates>, <hawkey.Package object id 13557, systemtap-client-3.3-1.fc28.x86_64, updates>, <hawkey.Package object id 28743, diffstat-1.61-6.fc28.x86_64, fedora>, <hawkey.Package object id 42632, libdwarf-20180129-4.fc28.x86_64, fedora>, <hawkey.Package object id 13561, systemtap-runtime-3.3-1.fc28.x86_64, updates>, <hawkey.Package object id 13559, systemtap-devel-3.3-1.fc28.x86_64, updates>, <hawkey.Package object id 29357, dyninst-9.3.2-11.fc28.x86_64, fedora>}

$ dnf groupremove "Development Tools"
Warning: Group 'Development Tools' is not installed.
Error: No groups marked for removal.

Expected results:
The dnf API to actually mark the group as installed.

Comment 3 Adam Miller 2018-09-06 14:44:07 UTC
Sorry, I realized my reproducer code I posed is incomplete. Here's a functional version. (Results are the same)


#!/usr/bin/python3

import dnf

base = dnf.Base()

conf = base.conf
conf.assumeyes = True
conf.read()

base.read_all_repos()
base.fill_sack(load_system_repo='auto')
base.read_comps()

group = base.comps.group_by_pattern("Development Tools")

base.group_install(group.id, dnf.const.GROUP_PACKAGE_TYPES)

base.resolve(allow_erasing=True)
print(base.transaction.install_set)
base.download_packages(base.transaction.install_set)

base.do_transaction()

Comment 4 Daniel Mach 2018-11-12 15:49:43 UTC
Adam,
I've reproduced the issue on F28, but I've also verified it's fixed on F29+ because there's new DNF with reworked groups.

Do you need this in F28 or are you ok with this being fixed in F29 and later?

Comment 5 Daniel Mach 2019-03-02 16:00:31 UTC
Works fine on F29.
Please reopen if you need it on F28 or any older release for any reason.

Comment 6 Red Hat Bugzilla 2023-09-18 00:14:21 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days