Bug 1034396

Summary: repo-override command should not require entitlements
Product: Red Hat Enterprise Linux 7 Reporter: Michael Stead <mstead>
Component: subscription-managerAssignee: Michael Stead <mstead>
Status: CLOSED CURRENTRELEASE QA Contact: John Sefler <jsefler>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: ckozak
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: 2014-06-13 09:55:33 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: 863175    

Description Michael Stead 2013-11-25 18:30:29 UTC
Description of problem:

Currently subscription-manager's repo-override command requires at least one entitlement in order to execute. This requirement should be removed as overrides live for the life of the consumer. For example, consider a repo override that has been added for 'repo1', which is provided by ent 1. If ent one is removed, the override remains. If no other ents exist, it is not possible to list/remove the override.

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


How reproducible:
Always

Steps to Reproduce:
1. Attach a subscription that provides content from a repository.
2. Add an override for any repo (existing or not)
subscription-manager repo-override --repo test-repo --add foo:1
3. Remove all subscriptions:
subscription-manager remove --all
4. List all overrides
subscription-manager repo-override
This system does not have any subscriptions.

Actual results:

After removing all subscriptions and listing overrides:

subscription-manager repo-override
This system does not have any subscriptions.


Expected results:

After removing all subscriptions and listing overrides, you should see the initial overrides that you created  in step 2.

Additional info:

This is not limited to the --list option of repo-override. A user should be able to perform any override oprations when they have no subscriptions attached.

Comment 1 Michael Stead 2013-11-27 13:06:46 UTC
Patch waiting on review:

https://github.com/candlepin/subscription-manager/pull/832

Comment 2 Michael Stead 2013-11-27 15:27:04 UTC
Available in:

subscription-manager-1.10.8-1

Comment 4 John Sefler 2013-12-06 17:47:30 UTC
Verifying Version...
[root@jsefler-7 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: Unknown
subscription-manager: 1.10.8-1.el7
python-rhsm: 1.10.8-1.el7

[root@jsefler-7 ~]# subscription-manager register --serverurl=jsefler-f14-candlepin.usersys.redhat.com:8443/candlepin
Username: testuser1
Password: 
Organization: admin
The system has been registered with ID: 51c808aa-f9b0-45a7-bd6b-e4b9b561c596 
[root@jsefler-7 ~]# subscription-manager repos --list
This system has no repositories available through subscriptions.
[root@jsefler-7 ~]# subscription-manager repo-override --list
This system does not have any content overrides applied to it.
[root@jsefler-7 ~]# subscription-manager repo-override --add=foo:bar --repo=my-repo
Repository 'my-repo' does not currently exist, but the override has been added.
[root@jsefler-7 ~]# subscription-manager repo-override --list
Repository: my-repo
  foo: bar

[root@jsefler-7 ~]# subscription-manager list --avail | grep Pool | tail -1
Pool ID:           8a90874042bf59cd0142bf5a9fbf0832
[root@jsefler-7 ~]# subscription-manager attach --pool 8a90874042bf59cd0142bf5a9fbf0832
Successfully attached a subscription for: RAM/Cores Package (8GB, 4 cores)
[root@jsefler-7 ~]# subscription-manager repos --list | head -8
+----------------------------------------------------------+
    Available Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo ID:   awesomeos
Repo Name: awesomeos
Repo URL:  https://cdn.redhat.com/path/to/$basearch/$releasever/awesomeos
Enabled:   0

[root@jsefler-7 ~]# subscription-manager repo-override --add=enabled:1 --repo=awesomeos
[root@jsefler-7 ~]# subscription-manager repos --list | head -8
+----------------------------------------------------------+
    Available Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo ID:   awesomeos
Repo Name: awesomeos
Repo URL:  https://cdn.redhat.com/path/to/$basearch/$releasever/awesomeos
Enabled:   1

[root@jsefler-7 ~]# subscription-manager repo-override --list
Repository: awesomeos
  enabled: 1

Repository: my-repo
  foo: bar

[root@jsefler-7 ~]# subscription-manager remove --all
1 subscription removed at the server.
1 local certificate has been deleted.
[root@jsefler-7 ~]# subscription-manager repo-override --list
Repository: awesomeos
  enabled: 1

Repository: my-repo
  foo: bar

[root@jsefler-7 ~]# subscription-manager repo-override --remove-all 
[root@jsefler-7 ~]# subscription-manager repo-override --list
This system does not have any content overrides applied to it.


VERIFIED: repo-overrides can now be manipulated independent of attached subscriptions.

Comment 5 Ludek Smid 2014-06-13 09:55:33 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.