Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1371472

Summary: The count of subscriptions is not properly handled when removing subscriptions.
Product: Red Hat Enterprise Linux 7 Reporter: qianzhan
Component: subscription-managerAssignee: candlepin-bugs
Status: CLOSED WONTFIX QA Contact: John Sefler <jsefler>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.3CC: csnyder, qianzhan, redakkan, skallesh
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-02 18:17: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:

Description qianzhan 2016-08-30 09:39:37 UTC
Description of problem:
The count of subscriptions is not properly handled when removing subscriptions.

Version-Release number of selected component (if applicable):
subscription-manager: 1.17.10-1.el7
python-rhsm: 1.17.6-1.el7


How reproducible:
always.

Steps to Reproduce:
1. Install RHEL-7.3-20160825.1.
2. Register and auto attach to prepare a valid entitlement cert.
[root@dhcp-129-48 ~]# subscription-manager register --auto-attach
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Username: new_test
Password: 
The system has been registered with ID: f694f0ee-9654-4c2f-b23d-b952fdf04cb6 

Installed Product Current Status:
Product Name: Red Hat Enterprise Linux Server
Status:       Subscribed

[root@dhcp-129-48 ~]# cat /etc/pki/entitlement/* > qq.pem
3. Remove all subscriptions, and the count of subscription is OKay,also the cert count.
[root@dhcp-129-48 ~]# subscription-manager remove --all
1 subscription removed at the server.
1 local certificate has been deleted.

4. Unregister the system, and import cert.
[root@dhcp-129-48 ~]# subscription-manager unregister
System has been unregistered.
[root@dhcp-129-48 ~]# subscription-manager import --cert qq.pem
Successfully imported certificate qq.pem

5. Remove all subscriptions.
[root@dhcp-129-48 ~]# subscription-manager remove --all
1 subscriptions removed from this system.
[root@dhcp-129-48 ~]# subscription-manager remove --all
0 subscriptions removed from this system.


Actual results:
As step 5.

Expected results:
The proper counts should be:
1) '1 subscription removed from this system.'
2) '0 subscription removed from this system.' Or 'No subscriptions removed from this system.'
Additional info:

Comment 2 Chris Snyder 2016-09-01 20:14:13 UTC
Not sure I see the bug here. The expected counts and the actual counts look the same to me. Are you asking us to change the plurality of the word 'subscription'?

Comment 3 qianzhan 2016-09-02 01:42:05 UTC
(In reply to Chris Snyder from comment #2)
> Not sure I see the bug here. The expected counts and the actual counts look
> the same to me. Are you asking us to change the plurality of the word
> 'subscription'?

Yes, Chris. Please modify the output information by removing 's' from 'subscriptions' in the 1 or 0 subscription scenario.

Comment 4 Chris Snyder 2016-09-02 18:17:59 UTC
I acknowledge that there is a grammatical error in the case that one subscription is removed. Given the amount of change necessary both in subscription-manager and in our tests I am closing this (as it only affects the one case and the counts are correct).