Bug 1225754

Summary: yum-config-manager --enable does not enable all repos
Product: Red Hat Enterprise Linux 6 Reporter: Karel Srot <ksrot>
Component: yum-utilsAssignee: Valentina Mukhamedzhanova <vmukhame>
Status: CLOSED ERRATA QA Contact: Eva Mrakova <emrakova>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.6CC: emrakova
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: yum-utils-1.1.30-33.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1151154 Environment:
Last Closed: 2016-05-10 21:32:05 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:

Description Karel Srot 2015-05-28 07:52:33 UTC
We should consider to fix it in RHEL-6 too. Although I don't know whether someone could rely on current --disable functionality and by fixing it we would break it.

+++ This bug was initially created as a clone of Bug #1151154 +++

Description of problem:
If you execute

    yum-config-manager --disable 

(yes, no repo name), it happily disables **all** repositories configured in the system. This is not documented in the man page.

If you execute 

    yum-config-manager --enable

again, without any repo name, it **doesn't** enable all repositories configured on the system. 

Version-Release number of selected component (if applicable):
yum-utils-1.1.31-25.el7_0.noarch


Steps to Reproduce:
1. sudo yum-config-manager --disable
2. yum repolist
3. yum-config-manager --enable
4. yum repolist

(Example outputs from CentOS 7 but it's the same in RHEL 7)

Actual results:
yum repolist
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
repolist: 0

Expected results:

yum repolist
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: centos.hyve.com
 * extras: mirror.as29550.net
 * updates: mirror.as29550.net
repo id                             repo name                             status
!base/7/x86_64                      CentOS-7 - Base                       8,465
!extras/7/x86_64                    CentOS-7 - Extras                        44
!updates/7/x86_64                   CentOS-7 - Updates                      995
repolist: 9,504

Additional info:
man page has no documentation. Also, no error is raised although this is not the documented behavior.
Also, the behavior is not consistent. Since it disables all repos with the --disable, it should enable all repos with --enable as well.

--- Additional comment from Valentina Mukhamedzhanova on 2015-04-02 04:56:21 EDT ---

Running 'yum-config-manager --enable' actually does give an error (although the message is kind of misleading).

if opts.enable and not args:
    logger.error("Error: Trying to enable already enabled repos.")
    opts.enable = False

I'd say the appropriate fix would be to change this error message, and add the same logic for --disable. We could also suggest using \* to enable/disable all repos.

--- Additional comment from Valentina Mukhamedzhanova on 2015-05-26 04:11:41 EDT ---

http://yum.baseurl.org/gitweb?p=yum-utils.git;a=commitdiff;h=b6e8afc8511262ca5405a084d806cdd5e52519c7

Comment 5 errata-xmlrpc 2016-05-10 21:32:05 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHEA-2016-0837.html