Bug 823438 - Subscription-manager unsubscribe --all throws 'int' object is unsubscriptable
Subscription-manager unsubscribe --all throws 'int' object is unsubscriptable
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager (Show other bugs)
6.3
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Adrian Likins
Entitlement Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-21 05:38 EDT by Shwetha Kallesh
Modified: 2012-05-22 13:15 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-05-22 13:15: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 Shwetha Kallesh 2012-05-21 05:38:27 EDT
Description of problem:
Subscription-manager unsubscribe --all throws 'int' object is unsubscriptable 

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


How reproducible:


Steps to Reproduce:
1.subscription-manager register --org=admin --user=admin --password=admin
2.subscription-manager subscribe --pool=8ac149343730a547013730a5f10603ac --pool=8ac149343730a547013730a5ed260239
3.subscription-manager unsubscribe --all
  
Actual results:
'int' object is unsubscriptable

Expected results:
Should unsubscribe all from all subscriptions

Additional info:
Comment 2 Adrian Likins 2012-05-21 10:37:24 EDT
I can't reproduce this with the pools I tried. 

What specific products/subscriptions did you install to?

    subscription-manager list --consumed

(should show me what I need to know)

Also, can I get the /var/log/rhsm.log output for this case?
Comment 3 Shwetha Kallesh 2012-05-22 02:44:15 EDT
[root@skallesh ~]# subscription-manager list --consumed
+-------------------------------------------+
    Consumed Product Subscriptions
+-------------------------------------------+

Product Name:         	Awesome OS for x86_64/i686/ia64/ppc/ppc64/s390x/s390 Bits
Contract:             	97                       
Account:              	12331131231              
Serial Number:        	3791330473866488672      
Active:               	True                     
Quantity Used:        	1                        
Service Level:        	                         
Service Type :        	                         
Begins:               	05/09/2012               
Expires:              	05/09/2013               

Product Name:         	Stackable with Awesome OS for x86_64 Bits
Contract:             	73                       
Account:              	12331131231              
Serial Number:        	3311628301423630975      
Active:               	True                     
Quantity Used:        	1                        
Service Level:        	                         
Service Type :        	                         
Begins:               	05/09/2012               
Expires:              	05/09/2013               

Product Name:         	Awesome OS Modifier Bits 
Contract:             	0                        
Account:              	12331131231              
Serial Number:        	595231864635042986       
Active:               	True                     
Quantity Used:        	1                        
Service Level:        	                         
Service Type :        	                         
Begins:               	05/09/2012               
Expires:              	05/09/2013               

Product Name:         	Awesome OS for x86_64 Bits
Contract:             	67                       
Account:              	12331131231              
Serial Number:        	7714969655110513488      
Active:               	True                     
Quantity Used:        	4                        
Service Level:        	                         
Service Type :        	                         
Begins:               	05/09/2012               
Expires:              	05/09/2013               

Product Name:         	Shared File System Bits  
Contract:             	127                      
Account:              	12331131231              
Serial Number:        	5021910800511151810      
Active:               	True                     
Quantity Used:        	1                        
Service Level:        	Layered                  
Service Type :        	                         
Begins:               	05/09/2012               
Expires:              	05/09/2013               

Product Name:         	Awesome OS Server Bits   
Contract:             	108                      
Account:              	12331131231              
Serial Number:        	2528927426948413763      
Active:               	True                     
Quantity Used:        	1                        
Service Level:        	                         
Service Type :        	                         
Begins:               	05/09/2012               
Expires:              	05/09/2013               

[root@skallesh ~]# subscription-manager unsubscribe --all
'int' object is unsubscriptable

[root@skallesh ~]# tail -f /var/log/rhsm/rhsm.log
2012-05-22 11:38:25,730 [DEBUG]  @connection.py:288 - Loading CA certificate: '/etc/rhsm/ca/candlepin-ca.pem'
2012-05-22 11:38:25,730 [DEBUG]  @connection.py:288 - Loading CA certificate: '/etc/rhsm/ca/redhat-uep.pem'
2012-05-22 11:38:25,731 [DEBUG]  @connection.py:327 - Making request: DELETE /candlepin/consumers/dc66cc8e-be85-417e-8c68-96b6e403577e/entitlements
2012-05-22 11:38:29,837 [DEBUG]  @connection.py:340 - Response status: 200
2012-05-22 11:38:29,839 [ERROR]  @managercli.py:104 - Unable to perform unsubscribe due to the following exception: 'int' object is unsubscriptable
2012-05-22 11:38:29,839 [ERROR]  @managercli.py:105 - 'int' object is unsubscriptable
Traceback (most recent call last):
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 1302, in _do_command
    print _("This machine has been unsubscribed from %s subscriptions" % total['deletedRecords'])
TypeError: 'int' object is unsubscriptable
Comment 4 Alex Wood 2012-05-22 09:24:01 EDT
What Candlepin installation are you running against?  As Devan Goodwin stated in an email, I changed that call to return an int and then to return a json struct.  I'm guessing that a newer version of subscription-manager is running against an Candlepin server with code from that very narrow window between the int/json change.
Comment 5 Adrian Likins 2012-05-22 13:04:39 EDT
What version of subscription-manager is this with?

The line numbers in the log don't seem to match up to what
I see for RHEL6.3
Comment 6 Adrian Likins 2012-05-22 13:15:58 EDT
This doesn't seem to be an issue with the version of subscription-manager intended for RHEL6.3 (.99.x) but instead an issue with the (1.0.x) branch.

Closing NOTABUG

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