Bug 773523

Summary: [ALL LANG] [RHSM CLI] unsubscribe module Unsubscribe with the same or wrong SerialNumber produces traceback "UnicodeEncodeError : 'ascii' codec can't encode characters ..."
Product: Red Hat Enterprise Linux 5 Reporter: Lijun Li <lijli>
Component: subscription-managerAssignee: William Poteat <wpoteat>
Status: CLOSED CURRENTRELEASE QA Contact: IDM QE LIST <seceng-idm-qe-list>
Severity: high Docs Contact:
Priority: unspecified    
Version: 5.8CC: bkearney, jmolet, lijli, qe-i18n-bugs
Target Milestone: rcKeywords: i18n
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-01-09 17:45:51 UTC Type: ---
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: 771748    
Attachments:
Description Flags
Unsubscribe with the same or wrong SerialNumber produces traceback none

Description Lijun Li 2012-01-12 06:41:42 UTC
Description of problem:
Unsubscribe with the same or wrong SerialNumber produces traceback. 

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


How reproducible:
100%

Steps to Reproduce:
1. Install rhel5.8 snapshot-3 OS build via
http://download.englab.nay.redhat.com/pub/rhel/rel-eng/RHEL5.8-Server-20120105.0/5/i386/os/
3.(Run the command when the system IS registered)

(Subscribe by 'sudo subscription-manager subscribe --auto' and run 'LANG=en_US subscription-manager list --consumed | grep SerialNumber' to get SerialNumber)


$ sudo subscription-manager unsubscribe --serial=SerialNumber

(Run the command again with same SerialNumber or wrong SerialNumber )

$ sudo subscription-manager unsubscribe --serial=SerialNumber

$ sudo subscription-manager unsubscribe --serial=wrong_SerialNumber

 
Actual results:
Unsubscribe with the same or wrong SerialNumber produces traceback. 


Expected results:
Should no traceback.

Additional info:

Comment 1 Lijun Li 2012-01-12 06:48:13 UTC
Created attachment 552320 [details]
Unsubscribe with the same or wrong SerialNumber produces traceback

Comment 3 J.C. Molet 2012-06-25 11:57:44 UTC
Testing with versions: 
python-rhsm-1.0.2-1.git.2.d5c3d05.el5
subscription-manager-1.0.4-1.git.20.0466bff.el5


[root@jmolet-vm0 ~]# subscription-manager clean
All local data removed
[root@jmolet-vm0 ~]# subscription-manager register --user testuser1 --pass password --org admin
The system has been registered with id: 509d3da3-075c-4ae0-9764-ff1b2b77ea02 

[root@jmolet-vm0 ~]# subscription-manager subscribe --pool=8a90f88f3822acb3013822ad737c045d
Successfully consumed a subscription for: Awesome OS with up to 4 virtual guests
[root@jmolet-vm0 ~]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Product Subscriptions
+-------------------------------------------+

Subscription Name:    	Awesome OS with up to 4 virtual guests
Provides:             	Awesome OS Server Bits
Contract:             	102
Account:              	12331131231
Serial Number:        	6210426182685478055
Active:               	True
Quantity Used:        	1
Service Level:        	None
Service Type:         	None
Starts:               	06/24/2012
Ends:                 	06/24/2013

[root@jmolet-vm0 ~]# subscription-manager unsubscribe --serial=6210426182685478055
This machine has been unsubscribed from subscription with serial number 6210426182685478055
[root@jmolet-vm0 ~]# subscription-manager unsubscribe --serial=6210426182685478055
Entitlement Certificate with serial number 6210426182685478055 could not be found.
[root@jmolet-vm0 ~]# subscription-manager unsubscribe --serial=6210426182685478055456666
6210426182685478055456666 is not a valid value for serial
[root@jmolet-vm0 ~]# subscription-manager unsubscribe --serial=621042618268547805A
Error: '621042618268547805A' is not a valid serial number
[root@jmolet-vm0 ~]# subscription-manager unsubscribe --serial=621042618268000000
Entitlement Certificate with serial number 621042618268000000 could not be found.
[root@jmolet-vm0 ~]# 


Cannot repro this bug as of the latest versions.  Marking VERIFIED.

Comment 4 Bryan Kearney 2013-01-09 17:45:51 UTC
Batch change of verified bugs which must have missed making the errata.