Bug 855957 - subscription-manager unsubscribe should cleanup the redhat.repo
subscription-manager unsubscribe should cleanup the redhat.repo
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: subscription-manager (Show other bugs)
5.9
Unspecified Unspecified
unspecified Severity low
: rc
: ---
Assigned To: Michael Stead
Entitlement Bugs
:
Depends On:
Blocks: 771748
  Show dependency treegraph
 
Reported: 2012-09-10 14:25 EDT by John Sefler
Modified: 2013-01-10 06:04 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-09-17 14:04:58 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description John Sefler 2012-09-10 14:25:44 EDT
Description of problem:
After a system unsubscribes, the redhat.repo currently remains dirty.  Currently we rely on rhsmcertd or subscription-manager yum plugin to clean the redhat.repo.  However discussions with alikins suggest that we could/should start empowering unsubscribe do the job of cleaning the redhat.repo.


Version-Release number of selected component (if applicable):
[root@jsefler-rhel59 ~]# rpm -q subscription-manager
subscription-manager-1.0.17-1.git.1.d19e6f7.el5


How reproducible:


Steps to Reproduce:
[root@rhsm-accept-rhel5 ~]# subscription-manager register --username stage_test_12 --serverurl subscription.rhn.stage.redhat.com:443/subscription
Password: 
The system has been registered with id: c5497094-3f13-4163-9af4-4df28dff2a44 

[root@rhsm-accept-rhel5 ~]# subscription-manager list --avail | grep "Pool Id" | head -1
Pool Id:              	8a99f9813870de960138d9847ed65119

[root@rhsm-accept-rhel5 ~]# subscription-manager subscribe --pool 8a99f9813870de960138d9847ed65119
Successfully consumed a subscription for: Red Hat Enterprise Linux Server, Premium (8 sockets) (Up to 4 guests)

[root@rhsm-accept-rhel5 ~]# yum -q repolist

[root@rhsm-accept-rhel5 ~]# head -20 /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
#

[rhel-5-server-rpms]
name = Red Hat Enterprise Linux 5 Server (RPMs)
baseurl = https://cdn.rcm-qa.redhat.com/content/dist/rhel/server/5/$releasever/$basearch/os
enabled = 1
gpgcheck = 1
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
sslverify = 1
sslcacert = /etc/rhsm/ca/redhat-uep.pem
sslclientkey = /etc/pki/entitlement/2464734009070827128-key.pem
sslclientcert = /etc/pki/entitlement/2464734009070827128.pem
metadata_expire = 86400

[root@rhsm-accept-rhel5 ~]# subscription-manager unsubscribe --all
This machine has been unsubscribed from 1 subscriptions

[root@rhsm-accept-rhel5 ~]# head -20 /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
#

[rhel-5-server-rpms]
name = Red Hat Enterprise Linux 5 Server (RPMs)
baseurl = https://cdn.rcm-qa.redhat.com/content/dist/rhel/server/5/$releasever/$basearch/os
enabled = 1
gpgcheck = 1
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
sslverify = 1
sslcacert = /etc/rhsm/ca/redhat-uep.pem
sslclientkey = /etc/pki/entitlement/2464734009070827128-key.pem
sslclientcert = /etc/pki/entitlement/2464734009070827128.pem
metadata_expire = 86400


^^^ EXPECTED THE redhat.repo file to be purged of the repos that were unentitled after running subscription-manager unsubscribe [--all|--serial]
Comment 1 RHEL Product and Program Management 2012-09-10 14:36:59 EDT
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.
Comment 2 James Bowes 2012-09-17 11:42:21 EDT
Is letting the file be updated by the next yum command not sufficient here?

If we're going to refresh the file directly after an unsubscribe, we mayaswell do it on a subscribe, too. Though I do still kind of like having subscription manager be decoupled from touching the repo file directly.
Comment 3 Bryan Kearney 2012-09-17 12:31:34 EDT
I am fine with yum plugins doing the work.
Comment 4 Michael Stead 2012-09-17 14:04:58 EDT
Closing as WONTFIX as per the comments above.

We will leave it up to the plugin to do the work.

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