Bug 1579792

Summary: [modularity] Enabling different stream from installed profile does not erase profile info
Product: [Fedora] Fedora Reporter: Rafael Fonseca <rdossant>
Component: dnfAssignee: Martin Hatina <mhatina>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 28CC: dmach, ksrot, mhatina, packaging-team-maint, rpm-software-management, vmukhame
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1579800 (view as bug list) Environment:
Last Closed: 2018-07-24 13:50:21 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, 1579800    

Description Rafael Fonseca 2018-05-18 10:44:05 UTC
Description of problem: In bug #1488089 it was fixed the issue when enabling another stream of a module with a profile installed, the profile info should be cleared. However, the issue persists if '--assumeyes' argument is used.


Version-Release number of selected component (if applicable): 2.7.5-12


How reproducible: always


Steps to Reproduce:
1. Enable some moduleA:streamS
2. Install a profileP
3. /etc/dnf/modules.d/moduleA.module contains
'profiles = profileP'
4. Run 'dnf module enable moduleA:streamT -y'

Actual results: /etc/dnf/modules.d/moduleA.module contains
'stream = streamT'
'profiles = profileP'


Expected results: profiles is empty


Additional info:
bash-4.4# dnf module enable ModuleA:f26
Last metadata expiration check: 0:00:43 ago on Fri May 18 10:39:42 2018.
'ModuleA:f26' is enabled
bash-4.4# dnf module install ModuleA/minimal
Last metadata expiration check: 0:00:53 ago on Fri May 18 10:39:42 2018.
Dependencies resolved.
========================================================================================================================================
 Package                      Arch                          Version                         Repository                             Size
========================================================================================================================================
Downgrading:
 TestA                        noarch                        1-2.modA                        modularityABDE                        6.4 k

Transaction Summary
========================================================================================================================================
Downgrade  1 Package

Total size: 6.4 k
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                1/1 
  Downgrading      : TestA-1-2.modA.noarch                                                                                          1/2 
  Erasing          : TestA-2-1.modA.noarch                                                                                          2/2 
  Verifying        : TestA-1-2.modA.noarch                                                                                          1/2 
  Verifying        : TestA-2-1.modA.noarch                                                                                          2/2 

Downgraded:
  TestA.noarch 1-2.modA                                                                                                                 

Complete!
bash-4.4# cat /etc/dnf/modules.d/ModuleA.module 
[ModuleA]
name = ModuleA
stream = f26
version = 2
profiles =minimal
enabled = 1
locked = 0

bash-4.4# dnf module enable ModuleA:f27 -y
Last metadata expiration check: 0:01:20 ago on Fri May 18 10:39:42 2018.
'ModuleA:f27' is enabled
bash-4.4# cat /etc/dnf/modules.d/ModuleA.module 
[ModuleA]
name = ModuleA
stream = f27
version = 2
profiles =minimal
enabled = 1
locked = 0

bash-4.4# dnf module enable ModuleA:f26
Last metadata expiration check: 0:02:43 ago on Fri May 18 10:39:42 2018.
Enabling different stream for 'ModuleA'.
Is this ok [y/N]: y
'ModuleA:f26' is enabled
bash-4.4# cat /etc/dnf/modules.d/ModuleA.module 
[ModuleA]
name = ModuleA
stream = f26
version = -1
profiles =
enabled = 1
locked = 0