Bug 864207

Summary: 'subscription-manager subscribe --auto' should be smart enough to not run when all products are subscribed already
Product: Red Hat Enterprise Linux 6 Reporter: Matt Reid <mreid>
Component: subscription-managerAssignee: William Poteat <wpoteat>
Status: CLOSED ERRATA QA Contact: IDM QE LIST <seceng-idm-qe-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.4CC: alikins, jmolet, jsefler, wpoteat
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: subscription-manager-1.1.11-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-21 08:58:59 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: 771481, 840993, 886216    

Description Matt Reid 2012-10-08 21:00:50 UTC
Description of problem:
Running 'subscription-manager subscribe --auto' on a system that is "green" and has all installed products subscribed already still results in the system trying to subscribe your products.

We should catch this and just return a string saying they're set and not make them wait for autobind to try to do its thing (and waste their time).

Seems like a good spot to use our status message from the GUI saying everything is subscribed, and then a quick note reinforcing that.
"System is properly subscribed through [DATE]. No need to autosubscribe."

Version-Release number of selected component (if applicable):
subscription-manager-1.1.2-1.git

Comment 2 William Poteat 2012-11-29 15:39:47 UTC
commit 006a990dd42fad5b5e395fe13dcc9e9f39d02fd9

Comment 3 Adrian Likins 2012-12-04 19:39:07 UTC
in rhel-64:


commit f35eb1325dafd8dd24b9ab1309deb9a9e45af3c0
Author: William Poteat <wpoteat>
Date:   Wed Nov 21 14:07:59 2012 -0500

    864207: Autosubscribe should not run when all products are already subscribed.
    
    Uses same logic and message on CLI that is used for GUI.
    Auto-subscribe is defeated if there are no unentitled products,
    expired products, partially-entitled products, or partial stacks.

Comment 5 John Sefler 2012-12-10 22:25:35 UTC
Verifying Version...
[root@rhsm-accept-rhel6 ~]# rpm -q subscription-manager
subscription-manager-1.1.11-1.el6.x86_64


[root@rhsm-accept-rhel6 ~]# subscription-manager register --serverurl=subscription.rhn.stage.redhat.com:443/subscription --username stage_test_12 --auto-attach
Password: 
The system has been registered with id: 61ab66d1-346e-4664-8bbb-e1dca8e9a3de 
Installed Product Current Status:
Product Name:         	Red Hat Enterprise Linux Server
Status:               	Subscribed

[root@rhsm-accept-rhel6 ~]# subscription-manager facts --list | grep valid
system.entitlements_valid: valid

[root@rhsm-accept-rhel6 ~]# subscription-manager subscribe --auto
All installed products are covered by valid entitlements. No need to update subscriptions at this time.
Installed Product Current Status:
Product Name:         	Red Hat Enterprise Linux Server
Status:               	Subscribed



VERIFIED: All installed products are covered by valid entitlements. No need to update subscriptions at this time.

Comment 7 errata-xmlrpc 2013-02-21 08:58:59 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.

http://rhn.redhat.com/errata/RHBA-2013-0350.html