Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 986292

Summary: Displaying wrong count of local certificates when removing a subscription
Product: Red Hat Enterprise Linux 5 Reporter: Rehana <redakkan>
Component: subscription-managerAssignee: candlepin-bugs
Status: CLOSED NOTABUG QA Contact: IDM QE LIST <seceng-idm-qe-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 5.10CC: bkearney, ckozak, fsharath, jmolet, jsefler, skallesh, spandey
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: 2013-07-22 15:38:27 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: 840995    

Description Rehana 2013-07-19 10:51:10 UTC
Description of problem:
When removing certain subscriptions observed that the no.of local certificates get removed is displayed wrongly

Version-Release number of selected component (if applicable):
[root@localhost facts]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 0.8.17-1
subscription-manager: 1.8.13-1.el5_9
python-rhsm: 1.8.13-1.el5_9


How reproducible:
2/4

Steps to Reproduce:
1.consumed list 
[root@localhost facts]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name: Awesome OS Instance Based (Standard Support)
Provides:          Awesome OS Instance Server Bits
SKU:               awesomeos-instancebased
Contract:          42
Account:           12331131231
Serial:            5756941374585920113
Pool ID:           8ac6a3f83ff5b63f013ff5b760060846
Active:            True
Quantity Used:     1
Service Level:     Standard
Service Type:      L1-L3
Status Details:    
Starts:            07/19/2013
Ends:              07/19/2014

Subscription Name: Multi-Attribute (non-stackable) (6 cores, 8GB)
Provides:          Multi-Attribute Limited Product
SKU:               non-stacked-6core8ram-multiattr
Contract:          234
Account:           12331131231
Serial:            8060108718597150335
Pool ID:           8ac6a3f83ff5b63f013ff5b7559a046f
Active:            True
Quantity Used:     1
Service Level:     Super
Service Type:      Level 3
Status Details:    
Starts:            07/19/2013
Ends:              07/19/2014

Subscription Name: Awesome OS Server Basic (dc-virt)
Provides:          Awesome OS Server Bits
SKU:               awesomeos-server-basic-vdc
Contract:          18
Account:           12331131231
Serial:            1494812855684809205
Pool ID:           8ac6a3f83ff5b63f013ff6546ed016fd
Active:            True
Quantity Used:     1
Service Level:     Full-Service
Service Type:      Drive-Through
Status Details:    
Starts:            07/19/2013
Ends:              07/19/2014

Subscription Name: Awesome OS Modifier
Provides:          Awesome OS Modifier Bits
SKU:               awesomeos-modifier
Contract:          0
Account:           12331131231
Serial:            7116474575512286699
Pool ID:           8ac6a3f83ff5b63f013ff5b762be0989
Active:            True
Quantity Used:     1
Service Level:     
Service Type:      
Status Details:    
Starts:            07/19/2013
Ends:              07/19/2014

2.Removing data center sub-pool subscription

[root@localhost facts]# subscription-manager remove --serial 1494812855684809205
Serial numbers successfully removed at the server:
   1494812855684809205
2 local certificates have been deleted.


Actual results:
Displayed "2 local certificates have been deleted." , when only 1 serial number is given

Expected results:
should display "1 local certificates have been deleted"

Additional info:
Having multiple products and subscriptions in the system, will help reproducing this bug easier

Comment 1 RHEL Program Management 2013-07-19 11:18:59 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.

Comment 2 Carter Kozak 2013-07-22 15:38:27 UTC
This is working as intended.  This happens because there is a modifier subscription installed, and the modified subscription is removed (which means we must remove the modifier as well)
The modifier subscription is actually replaced.  If you list --consumed afterward, you'll notice that the serial has changed.

[root@ckozak-desktop ckozak]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name: Awesome OS Server Basic
Provides:          Awesome OS Server Bits
SKU:               awesomeos-server-basic
Contract:          13
Account:           12331131231
Serial:            4239246919217791088
Pool ID:           ff8080813ff291c6013ff292e5990442
Active:            True
Quantity Used:     1
Service Level:     None
Service Type:      Self-Support
Status Details:    
Starts:            07/17/2013
Ends:              07/17/2014

Subscription Name: Awesome OS Modifier
Provides:          Awesome OS Modifier Bits
SKU:               awesomeos-modifier
Contract:          1
Account:           12331131231
Serial:            4280917935826958276
Pool ID:           ff8080813ff291c6013ff292e52f03f5
Active:            True
Quantity Used:     1
Service Level:     
Service Type:      
Status Details:    
Starts:            07/17/2013
Ends:              07/17/2014

[root@ckozak-desktop ckozak]# subscription-manager remove --serial 4239246919217791088
Serial numbers successfully removed at the server:
   4239246919217791088
deleting ff8080814006a36c01400702a7c800e1
deleting ff8080814006a36c014007032ad100e4
2 local certificates have been deleted.

[root@ckozak-desktop ckozak]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name: Awesome OS Modifier
Provides:          Awesome OS Modifier Bits
SKU:               awesomeos-modifier
Contract:          1
Account:           12331131231
Serial:            5168308126033982552
Pool ID:           ff8080813ff291c6013ff292e52f03f5
Active:            True
Quantity Used:     1
Service Level:     
Service Type:      
Status Details:    
Starts:            07/17/2013
Ends:              07/17/2014