Description of problem: Can't unsubscribe all the subscriptions when run "subscription-manager unsubscribe --all" CLI. Version-Release number of selected component (if applicable): katello-configure-0.3.3-2.el6_2.noarch katello-headpin-all-0.2.6-4.el6_2.noarch katello-common-0.3.1-1.el6_2.noarch katello-cli-common-0.3.2-3.el6_2.noarch katello-headpin-0.2.6-4.el6_2.noarch katello-glue-candlepin-0.3.1-1.el6_2.noarch katello-cli-headpin-0.2.0-1.el6_2.noarch katello-selinux-0.2.4-1.el6_2.noarch katello-candlepin-cert-key-pair-1.0-1.noarch katello-certs-tools-1.1.5-1.el6_2.noarch candlepin-0.6.2-1.el6_2.noarch katello-glue-candlepin-0.3.1-1.el6_2.noarch candlepin-tomcat6-0.6.2-1.el6_2.noarch katello-candlepin-cert-key-pair-1.0-1.noarch thumbslug-0.0.24-1.el6_2.noarch How reproducible: 100% Steps to Reproduce: 1.Register to sam (SAM-2012-05-15.1) # subscription-manager register Username: admin Password: The system has been registered with id: 5b67802c-3970-4710-80fe-c347a4f0eb57 2.Subscribe # subscription-manager subscribe --auto Installed Product Current Status: Product Name: Red Hat Enterprise Linux Server Status: Subscribed 3.Unsubscribe #subscription-manager unsubscribe --all No JSON object could be decoded 4.List consumed subscriptions #subscription-manager list --consumed +-------------------------------------------+ Consumed Product Subscriptions +-------------------------------------------+ ProductName: Red Hat Enterprise Linux Server ContractNumber: 2596950 AccountNumber: 477931 SerialNumber: 7126170976071892814 Active: True QuantityUsed: 1 Begins: 10/08/2011 Expires: 01/01/2022 ....... Actual results: Can't unsubscribe the consumed subscriptions. Expected results: After running "subscription-manager unsubscribe --all", then run "subscription-manager list --consumed", it will give the "No consumed subscription pools to list" prompt. Additional info:
Hui, I was able to replicate the issue, but I am still determining what the best fix is.
Created attachment 585301 [details] pass json back from delete call
To replicate this bug, you can just run "unsubscribe --all" without having to consume entitlements first.
merged https://github.com/Katello/katello/pull/127
unsubscribe --all still unsubscribe all the entitlements, and report: "Expected /usr/share/katello/lib/resources/candlepin.rb to define Resources::Candlepin". Version: subscription-manager-0.99.19 katello-common-0.3.2-1.el6_2.noarch katello-headpin-all-0.2.9-1.el6_2.noarch katello-glue-candlepin-0.3.2-1.el6_2.noarch katello-cli-headpin-0.2.2-1.el6_2.noarch katello-headpin-0.2.9-1.el6_2.noarch katello-configure-0.3.6-1.el6_2.noarch katello-cli-common-0.3.4-1.el6_2.noarch katello-selinux-0.2.4-1.el6_2.noarch katello-candlepin-cert-key-pair-1.0-1.noarch katello-certs-tools-1.1.5-1.el6_2.noarch katello-glue-candlepin-0.3.2-1.el6_2.noarch candlepin-0.6.3-1.el6_2.noarch katello-candlepin-cert-key-pair-1.0-1.noarch candlepin-tomcat6-0.6.3-1.el6_2.noarch thumbslug-0.0.24-1.el6_2.noarch
Verified. The result is PASS. Packages Tested: subscription-manager-0.99.19-1.el6.x86_64 katello-headpin-0.2.10-1.el6_2.noarch katello-configure-0.3.7-1.el6_2.noarch katello-headpin-all-0.2.10-1.el6_2.noarch katello-common-0.3.2-1.el6_2.noarch katello-cli-common-0.3.4-1.el6_2.noarch katello-selinux-0.2.4-1.el6_2.noarch katello-glue-candlepin-0.3.2-1.el6_2.noarch katello-cli-headpin-0.2.2-1.el6_2.noarch katello-candlepin-cert-key-pair-1.0-1.noarch katello-certs-tools-1.1.5-1.el6_2.noarch candlepin-tomcat6-0.6.5-1.el6_2.noarch candlepin-0.6.5-1.el6_2.noarch thumbslug-0.0.24-1.el6_2.noarch 1.#subscription-manager subscribe --auto --servicelevel=None 2.# subscription-manager list --consumed +-------------------------------------------+ Consumed Product Subscriptions +-------------------------------------------+ Product Name: Red Hat Enterprise Linux Server Contract Number: 2596950 Account Number: 477931 Serial Number: 1374830180863246400 Active: True Quantity Used: 1 Service Level: None Service Type : None Begins: 10/08/2011 Expires: 01/01/2022 3.#subscription-manager unsubscribe --all 4.# subscription-manager list --consumed No consumed subscription pools to list
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: User cannot unsubscribe consumed subscriptions when running the command: "subscription-manager unsubscribe --all". This update passes json back from delete call and user is now able to unsubscribe consumed subscriptions.
Technical note updated. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. Diffed Contents: @@ -1 +1 @@ -User cannot unsubscribe consumed subscriptions when running the command: "subscription-manager unsubscribe --all". This update passes json back from delete call and user is now able to unsubscribe consumed subscriptions.+Due to a lack of JSON object upon return, user cannot unsubscribe all consumed subscriptions via CLI. This update returns JSON from delete call and user is now able to unsubscribe all consumed subscriptions via CLI.
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-2012-1021.html