Bug 1561303 - Random profiles shouldn't get enabled
Summary: Random profiles shouldn't get enabled
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 28
Hardware: Unspecified
OS: Unspecified
low
unspecified
Target Milestone: ---
Assignee: rpm-software-management
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1478068
TreeView+ depends on / blocked
 
Reported: 2018-03-28 04:35 UTC by sumantro
Modified: 2018-11-22 18:22 UTC (History)
7 users (show)

Fixed In Version: dnf-4.0.4
Clone Of:
Environment:
Last Closed: 2018-11-22 18:22:34 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description sumantro 2018-03-28 04:35:45 UTC
Description of problem:
While enabling a module, the user can only use an enum list ['default', 'development', 'minimal'] using anything else should result in an error


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


How reproducible:
Always


Steps to Reproduce:
1. 
2.
3.

Actual results:
Modules shouldn't get enabled


Expected results:
The user shouldn't be able to put random profile name and still enable the module in the first place


Additional info:
[root@localhost ~]# dnf module enable nodejs/bug                                                         
Last metadata expiration check: 0:29:23 ago on Wed 28 Mar 2018 09:27:01 AM IST.                          
'nodejs/bug' is enabled                                                                                  
[root@localhost ~]# dnf module enable nodejs:8/ada                                                       
Last metadata expiration check: 0:29:56 ago on Wed 28 Mar 2018 09:27:01 AM IST.                          
Enabling different stream for 'nodejs'                                                                   
Is this ok [y/N]: y                                                                                      
'nodejs:8/ada' is enabled                                                                                
[root@localhost ~]# dnf module enable nodejs:8/yummy                                                     
Last metadata expiration check: 0:30:12 ago on Wed 28 Mar 2018 09:27:01 AM IST.                          
'nodejs:8/yummy' is enabled                                                                              
[root@localhost ~]# dnf module install nodejs/yummy                                                      
Last metadata expiration check: 0:30:56 ago on Wed 28 Mar 2018 09:27:01 AM IST.                          
Error: No such profile: nodejs:8:20180308143646/yummy. Possible profiles: ['default', 'development', 'min
imal']

Comment 1 Stephen Gallagher 2018-03-28 17:00:47 UTC
When doing `dnf module enable`, we should probably do one of the following:

1) Disallow the `/profile` suffix to the module. It's meaningless during the enable step anyway. So we could throw an error if it's provided here.

2) Warn that the `/profile` was superfluous and then indicate the the base module was enabled.

3) Assume this to mean that the user wanted this profile to become the default for the stream and automatically write out a modulemd-defaults file for it in /etc.


I'm going to strongly recommend *against* 3, as I think we shouldn't be making implicit decisions about local default overrides. As far as the first two, I think 2) is probably the most user-friendly; it's informative but doesn't require them to retype anything.

Comment 2 Martin Hatina 2018-04-06 13:16:57 UTC
Best will be to go with option #2 from comment #1. It is more user friendly than option #1.

Comment 3 Martin Hatina 2018-07-24 13:45:07 UTC
Fixed in https://github.com/rpm-software-management/dnf/pull/1144


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