Bug 1330003

Summary: yum-config-manager --add-repo fails with IndexError when no .repo files present
Product: Red Hat Enterprise Linux 6 Reporter: Eva Mrakova <emrakova>
Component: yum-utilsAssignee: Valentina Mukhamedzhanova <vmukhame>
Status: CLOSED WONTFIX QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.8CC: carl, emrakova, mdomonko, mfrodl, vmukhame, zdenek.juran
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1184912 Environment:
Last Closed: 2017-12-06 11:07:45 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 Eva Mrakova 2016-04-25 09:18:06 UTC
Also happens for yum-utils-1.1.30-37.el6

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

Description of problem:

When /etc/yum.repos.d contains no .repo files, yum-config-manager fails to add a new repository via the --add-repo option, producing a traceback.

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

Steps to Reproduce:

# for repo in /etc/yum.repos.d/*; do mv $repo $repo.disabled; done
# yum-config-manager --add-repo ceph.repo 
Loaded plugins: priorities, product-id
adding repo from: ceph.repo
Traceback (most recent call last):
  File "/usr/bin/yum-config-manager", line 209, in <module>
    grabber = yb.repos.listEnabled()[0].grabfunc            
IndexError: list index out of range

...
--- Additional comment from Zdenek Juran on 2016-01-15 10:21:20 CET ---

BTW you don't need to move repository definitions out it is enough to make them disabled by: yum-config-manager --disable <list-of-repos>

Comment 3 Jan Kurik 2017-12-06 11:07:45 UTC
Red Hat Enterprise Linux 6 is in the Production 3 Phase. During the Production 3 Phase, Critical impact Security Advisories (RHSAs) and selected Urgent Priority Bug Fix Advisories (RHBAs) may be released as they become available.

The official life cycle policy can be reviewed here:

http://redhat.com/rhel/lifecycle

This issue does not meet the inclusion criteria for the Production 3 Phase and will be marked as CLOSED/WONTFIX. If this remains a critical requirement, please contact Red Hat Customer Support to request a re-evaluation of the issue, citing a clear business justification. Note that a strong business justification will be required for re-evaluation. Red Hat Customer Support can be contacted via the Red Hat Customer Portal at the following URL:

https://access.redhat.com/