Bug 735338 - subscription-manager CLI tool does not allow unsubscribe when not registered
subscription-manager CLI tool does not allow unsubscribe when not registered
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager (Show other bugs)
6.2
Unspecified Unspecified
unspecified Severity high
: rc
: ---
Assigned To: William Poteat
John Sefler
:
Depends On:
Blocks: rhsm-rhel62 743047
  Show dependency treegraph
 
Reported: 2011-09-02 08:11 EDT by John Sefler
Modified: 2011-12-06 12:24 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-12-06 12:24:02 EST
Type: ---
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 2011-09-02 08:11:39 EDT
Description of problem:
In the user scenario where the system is running disconnected and they have imported an entitlement certificate, the cli tool does not allow them to unsubscribe.  The command is blocked with a "you need to register before" using this command.  This scenario was fixed for the gui tool in bug 723363, but not the cli tool.

Version-Release number of selected component (if applicable):
[root@jsefler-onprem-62server ~]# rpm -q subscription-manager
subscription-manager-0.96.8-1.git.0.125eb68.el6.x86_64


How reproducible:


Steps to Reproduce:
[root@jsefler-onprem-62server ~]# subscription-manager identity
Consumer not registered. Please register using --username and --password
[root@jsefler-onprem-62server ~]# subscription-manager import --certificate=/tmp/sm-importCertificatesDir/5614217831278296352.pem 
Successfully imported certificate 5614217831278296352.pem
[root@jsefler-onprem-62server ~]# subscription-manager list --consumed
+-------------------------------------------+
    Consumed Product Subscriptions
+-------------------------------------------+


ProductName:        	Awesome OS Server Bits   
ContractNumber:     	66                       
AccountNumber:      	12331131231              
SerialNumber:       	5614217831278296352      
Active:             	True                     
QuantityUsed:       	1                        
Begins:             	05/29/2011               
Expires:            	10/28/2012               

[root@jsefler-onprem-62server ~]# subscription-manager unsubscribe --serial=5614217831278296352
Error: You need to register this system by running `register` command before using this option.

^^^ BANG! A client who has just successfully imported an entitlement cert cannot revert his action and unsubscribe using the subscription-manager cli tool.
Comment 3 William Poteat 2011-09-12 08:11:22 EDT
commit c5843112b4e6a221c1eb95a3abdc800d805324d1
Author: William Poteat <wpoteat@redhat.com>
Date:   Wed Sep 7 08:49:22 2011 -0400

    735338: Subscription Manager CLI tool does not allow unsubscribe when not registered.
    
    735212: Subscription-manager import help should use singular CERTIFICATE-FILE
Comment 4 John Sefler 2011-09-13 14:51:37 EDT
Verifying Version...
[root@jsefler-onprem-62server ~]# rpm -q subscription-manager
subscription-manager-0.96.9-1.git.10.adab5e3.el6.x86_64
[root@jsefler-onprem-62server ~]# rpm -q python-rhsm
python-rhsm-0.96.11-1.git.8.7061b8a.el6.noarch


[root@jsefler-onprem-62server ~]# subscription-manager clean
All local data removed
[root@jsefler-onprem-62server ~]# subscription-manager import --certificate=/tmp/sm-importCertificatesDir/9196177807768642459.pem
Successfully imported certificate 9196177807768642459.pem
[root@jsefler-onprem-62server ~]# subscription-manager list --consumed
+-------------------------------------------+
    Consumed Product Subscriptions
+-------------------------------------------+


ProductName:        	Awesome OS for i686/x86_64 Bits
ContractNumber:     	45                       
AccountNumber:      	12331131231              
SerialNumber:       	9196177807768642459      
Active:             	True                     
QuantityUsed:       	1                        
Begins:             	09/11/2011               
Expires:            	09/10/2012               

[root@jsefler-onprem-62server ~]# subscription-manager identity
Consumer not registered. Please register using --username and --password
[root@jsefler-onprem-62server ~]# subscription-manager unsubscribe --serial=9196177807768642459
This machine has been unsubscribed from subscription with serial number 9196177807768642459
[root@jsefler-onprem-62server ~]# subscription-manager list --consumed
No Consumed subscription pools to list
[root@jsefler-onprem-62server ~]# 


^^^ VERIFIED that an unregistered client can unsubscribe from an imported entitlement cert.
Comment 5 errata-xmlrpc 2011-12-06 12:24:02 EST
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-2011-1695.html

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