Bug 1568153

Summary: [modularity] removing a module should disable it, even if there's nothing to do
Product: [Fedora] Fedora Reporter: Merlin Mathesius <mmathesi>
Component: dnfAssignee: rpm-software-management
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 28CC: dmach, mhatina, packaging-team-maint, rpm-software-management, vmukhame
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-23 11:22:57 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: 1478068    

Description Merlin Mathesius 2018-04-16 21:02:17 UTC
Description of problem:
Removing a module with "dnf module remove" doesn't disable it. It should be disabled, even if there are no installed RPMs.

This is rather unexpected. You could end up with new RPMs on your system as the module that you thought you removed gets updates and its selected profile grows.


Version-Release number of selected component (if applicable):
dnf-2.7.5-19.fc28.modularity.1.3fb9e5c.git.8118.7bc81fe.noarch


How reproducible:
always


Steps to Reproduce:
1. fresh container based on docker.io/fedora:28 (or other current F28 VM/container) with latest F28 updates, fedora-repos-modular enabled, and latest patched dnf from COPR
2. dnf module list --enabled # nothing enabled
3. dnf -y module install nodejs:8/minimal
4. dnf module list --enabled # confirmed enabled
5. dnf -y module remove nodejs # Error: Different stream enabled for module: nodejs
6. dnf module list --enabled # still enabled
7. dnf -y module remove nodejs:8 # removed now
8. dnf module list --enabled # nodejs:8 still enabled?
9. dnf list --installed 'nodejs*' npm # confirmed no module packages still installed


Actual results:
At step 5, failed with Error: Different stream enabled for module: nodejs
At step 8, removed nodejs:8 was still enabled


Expected results:
At step 5, enabled stream nodejs:8 should have been removed
Step 7 should not have been needed
At step 8, no modules should have been enabled


Additional info:
If the Steps to Reproduce above is modified by also running "dnf -y remove nodejs npm" immediately after step 4 (to remove all packages installed by step 3), the module should still be disabled when it is explicitly removed in subsequent steps.

Comment 2 Daniel Mach 2018-04-23 11:22:57 UTC
I believe we discussed this with broader audience and the conclusion was not to disable modules with remove command.
DNF team supports the conclusion.
We want to do it also for UX consistency.
- When a user specifies N:S to install, it gets expanded with default profiles or 'default' profile; There's no opposite for remove.