Bug 1730162 - "dnf module reset" will clear the "install" information
Summary: "dnf module reset" will clear the "install" information
Keywords:
Status: VERIFIED
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: dnf
Version: ---
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: rc
: 8.0
Assignee: Pavla Kratochvilova
QA Contact: Eva Mrakova
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-07-16 03:01 UTC by yalzhang@redhat.com
Modified: 2020-02-14 07:30 UTC (History)
3 users (show)

Fixed In Version: dnf-4.2.11-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)

Description yalzhang@redhat.com 2019-07-16 03:01:09 UTC
Description of problem:
 "dnf module reset" will clear the "install" information

Version-Release number of selected component (if applicable):
# rpm -q dnf rpm
dnf-4.0.9.2-5.el8.noarch
rpm-4.14.2-9.el8.x86_64

How reproducible:
100%

Steps to Reproduce:
1. 
# dnf module list virt
...
800_app
Name                           Stream                                Profiles                                 Summary                                        
virt                           rhel [d][e]                           common [d] [i]                           Virtualization module                          

Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled

2. 
# dnf module reset virt
...
Dependencies resolved.
========================================================================================================================
 Package                              Arch                                Version                                 Repository                            Size
========================================================================================================================
Removing module profiles:
 virt/common                                                                                                                                                
Resetting module streams:
 virt                                                                     rhel                                                                              

Transaction Summary
=======================================================================================================================

Is this ok [y/N]: y
Complete!

# dnf module list virt
...
800_app
Name                             Stream                               Profiles                               Summary                                         
virt                             rhel [d]                             common [d]                             Virtualization module                           

Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled

3.
# dnf module remove virt
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Last metadata expiration check: 0:06:28 ago on Tue 16 Jul 2019 02:29:44 AM EDT.
Unable to match profile in argument virt
Dependencies resolved.
Nothing to do.
Complete!

# dnf module list --installed
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Last metadata expiration check: 0:06:53 ago on Tue 16 Jul 2019 02:29:44 AM EDT.
No matching Modules to list

Actual results:
Step 2, "dnf module reset" will clear the "installed" information

Expected results:
The reset command should not clear the "installed" information

Additional info:
In the man page, it says the reset command is only to make the module no longer enabled or disabled.
"       dnf [options] module reset <module-spec>...
              Reset module state so it's no longer enabled or disabled."

But in fact, after reset, the packages is still visible by yum/dnf, it is the same as "enabled", only clear the "[i]" in the module list output. 
# yum module list virt
...
800_app
Name                  Stream                   Profiles                   Summary                              
virt                  rhel [d]                 common [d]                 Virtualization module 

# yum provides libguestfs    ====> for package in the profile, it it still visible by yum/dnf
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Last metadata expiration check: 0:23:13 ago on Tue 16 Jul 2019 02:29:43 AM EDT.
libguestfs-1:1.38.4-10.module+el8+2709+40ed2f2c.x86_64 : Access and modify virtual machine disk images
Repo        : 800_app
Matched from:
Provide    : libguestfs = 1:1.38.4-10.module+el8+2709+40ed2f2c

After disable, the packages in the module are invisible by yum/dnf
# yum module disable virt
# yum module list virt
...
800_app
Name                 Stream                      Profiles                  Summary                             
virt                 rhel [d][x]                 common [d]                Virtualization module               

Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled

# yum provides libguestfs  =====> for packages in the profile
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Last metadata expiration check: 0:21:24 ago on Tue 16 Jul 2019 02:29:43 AM EDT.
Error: No Matches found

# yum provides qemu-kvm  ====> for packages do not in the profile but in the module
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Last metadata expiration check: 0:21:06 ago on Tue 16 Jul 2019 02:29:43 AM EDT.
Error: No Matches found

Comment 1 Pavla Kratochvilova 2019-07-23 08:24:58 UTC
This is actually expected behavior.

A module profile can be installed only for an enabled stream (when you install a profile, streams get enabled accordingly). Therefore, when you reset a module, no stream is enabled and all the profiles get removed.

I can enhance the documentation, so that it is clear that reset also has this effect.

Additionally, you are mentioning package visibility. All packages from enabled and default streams are visible, other modules packages are not visible. Since the module stream you are mentioning is default (indicated by the "[d]"), it is expected that you can see its packages.

Is this explanation sufficient?

Comment 2 Pavla Kratochvilova 2019-07-23 10:23:06 UTC
PR that improves the documentation: https://github.com/rpm-software-management/dnf/pull/1437

Comment 3 yalzhang@redhat.com 2019-07-25 08:50:28 UTC
(In reply to Pavla Kratochvilova from comment #1)
> This is actually expected behavior.
> 
> A module profile can be installed only for an enabled stream (when you
> install a profile, streams get enabled accordingly). Therefore, when you
> reset a module, no stream is enabled and all the profiles get removed.
> 
> I can enhance the documentation, so that it is clear that reset also has
> this effect.
> 
> Additionally, you are mentioning package visibility. All packages from
> enabled and default streams are visible, other modules packages are not
> visible. Since the module stream you are mentioning is default (indicated by
> the "[d]"), it is expected that you can see its packages.
> 
> Is this explanation sufficient?

Yes, it's very clear. Thank you very much!


Note You need to log in before you can comment on or make changes to this bug.