Bug 1017866

Summary: attaching a subscription should not update redhat.repo when yum plugin is disabled
Product: Red Hat Enterprise Linux 6 Reporter: John Sefler <jsefler>
Component: subscription-managerAssignee: candlepin-bugs
Status: CLOSED NOTABUG QA Contact: John Sefler <jsefler>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.5Keywords: Regression
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-10 22:06:50 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: 862910    

Description John Sefler 2013-10-10 16:06:06 UTC
Description of problem:
I suspect that newly implemented RFE bug 1008016 introduced this regression.
When the /etc/yum/pluginconf.d/subscription-manager.conf is disabled, there should not be any updates made to /etc/yum.repos.d/redhat.repo as subscriptions are attached/removed.


Version-Release number of selected component (if applicable):
[root@jsefler-6 ~]# rpm -q --whatprovides /etc/yum/pluginconf.d/subscription-manager.conf
subscription-manager-1.9.9-1.el6.x86_64


How reproducible:


Steps to Reproduce:
1. register and unsubscribe all (should not have any entitlements)

2. [root@jsefler-6 ~]# cat /etc/yum.repos.d/redhat.repo 
#
# Certificate-Based Repositories
# Managed by (rhsm) subscription-manager
#
# If this file is empty and this system is subscribed consider 
# a "yum repolist" to refresh available repos
#

^^^ Notice the redhat.repo has no repos defined when no subscriptions have been attached.  This is expected.

3. Edit /etc/yum/pluginconf.d/subscription-manager.conf and set enabled=0
[root@jsefler-6 ~]# cat /etc/yum/pluginconf.d/subscription-manager.conf
[main]
enabled=0

4. Attach a subscription that provides content.
[root@jsefler-6 ~]# subscription-manager attach --pool 8a9087404175311a01417531f1051428
Successfully attached a subscription for: Awesome OS Server Basic

5. [root@jsefler-6 ~]# cat /etc/yum.repos.d/redhat.repo 
#
# Certificate-Based Repositories
# Managed by (rhsm) subscription-manager
#
# If this file is empty and this system is subscribed consider 
# a "yum repolist" to refresh available repos
#

[content-label-empty-gpg]
name = content-emptygpg
baseurl = https://cdn.redhat.com/foo/path
enabled = 0
gpgcheck = 0
sslverify = 1
sslcacert = /etc/rhsm/ca/redhat-uep.pem
sslclientkey = /etc/pki/entitlement/5617235906887313917-key.pem
sslclientcert = /etc/pki/entitlement/5617235906887313917.pem

[content-label]
name = content
baseurl = https://cdn.redhat.com/foo/path
enabled = 0
gpgcheck = 1
gpgkey = https://cdn.redhat.com/foo/path/gpg/
sslverify = 1
sslcacert = /etc/rhsm/ca/redhat-uep.pem
sslclientkey = /etc/pki/entitlement/5617235906887313917-key.pem
sslclientcert = /etc/pki/entitlement/5617235906887313917.pem

^^^ FAILED: No content repos should have been added to redhat.repo when /etc/yum/pluginconf.d/subscription-manager.conf is disabled.

Comment 1 John Sefler 2013-10-10 22:06:50 UTC
Closing this bug / working as designed.

There are actually two configurations that are easy to confuse.

1.
/etc/yum/pluginconf.d/subscription-manager.conf controls the enablement of the subscription-manager yum plugin.

2.
/etc/rhsm/rhsm.conf contains an rhsm manage_repos configuration that will set the enablement for managing yum repos in /etc/yum.repos.d/redhat.repo that originate from attached entitlement subscriptions.

Hence the reason for the perceived behavior failure in comment 0 was because the rhsm manage_repos configuration in /etc/rhsm/rhsm.conf was enabled.