Hide Forgot
Description of problem: params needed to unsubscribe system in Katello CLI and RHSM differs: CLI: system unsubscribe --org ACME_Corporation --name mbacovsk-test1.redhat.com --pool=ff80808134cde4dc0134d1ac03290027 (the --pool means in fact entitlement, it will be fixed) RHSM: subscription-manager unsubscribe --serial=<serial> CLI (as well as Candlepin API) uses entitlementId while RHSM uses serial. Version-Release number of selected component (if applicable): katello-cli-0.1.35 subscription-manager-0.99.4 How reproducible: always Expected results: CLI and RHS use the same input for the same action
Copied from inecas's comment on mailing list (for tracking purposes) There are 3 ways how to unsubscribe in CP: 1. DELETE "/candlepin/consumers/d4b32e09-4bab-4fe2-a98b-ce7ec96cb8cb/certificates/6444937435662822417" (used by subscription-manager unsubscribe --serial) AND 2. DELETE /candlepin/consumers/d4b32e09-4bab-4fe2-a98b-ce7ec96cb8cb/entitlements/4028fa8134f045a10134f048a0ed0026 (used by katello unsubscribe) AND 3. DELETE /candlepin/consumers/d4b32e09-4bab-4fe2-a98b-ce7ec96cb8cb/entitlements (used by subscription-manager unsubscribe --all)
Since katello-0.1.195-1 and katello-cli-0.1.41-1 the CLI is fixed as follows CLI: system unsubscribe --org <org> --name <name> --entitlement <ent_id> system unsubscribe --org <org> --name <name> --serial <serial_id> system unsubscribe --org <org> --name <name> --all Serial and entitlement ids are listed via: system subscrptions --org <org> --name <name> Available pools via system subscrptions --org <org> --name <name> --available
Verified with following katello build: katello-cli-0.1.42-1.el6.noarch katello-0.1.195-1.el6.noarch Now we can unsubscribe a product with entitlement id as well as serial cert id. And for unsubscription katello cli has same params as for rhsm ( i.e. --serial) Help text is updated and includes entitlement instead of pool id. Also include the serial id of certificate to unsubscribe the product. katello> system unsubscribe --help Usage: katello [options] Options: -h, --help show this help message and exit -g grep friendly output -v verbose, more structured output -d DELIMITER grep friendly output column delimiter --org=ORG organization name (required) --name=NAME system name (required) --entitlement=ENTITLEMENT entitlement id to unsubscribe from (either entitlement or serial or all is required) --serial=SERIAL serial id of a certificate to unsubscribe from (either entitlement or serial or all is required) --all unsubscribe from all currently subscribed certificates (either entitlement or serial or all is required) katello> katello> system subscriptions --org ACME_Corporation --name dhcp193-78.pnq.redhat.com ---------------------------------------------------------------------------------------------- Current Subscriptions for System [ dhcp193-78.pnq.redhat.com ] ---------------------------------------------------------------------------------------------- EntitlementId: 8ac1490f35138547013514be662b003b Serial Id: 3219094884821188044 PoolName: pulp Expires: 01/17/2042 Consumed: 1 Quantity: 1 Sla: ContractNumber: Provided products:
Unsubscribing the system with entitlement id :success ====================================================== katello> system subscriptions --name dhcp193-78.pnq.redhat.com --org ACME_Corporation ---------------------------------------------------------------------------------------------- Current Subscriptions for System [ dhcp193-78.pnq.redhat.com ] ---------------------------------------------------------------------------------------------- EntitlementId: 8ac1490f35138547013514c8ce10003f Serial Id: 7988125811537418628 PoolName: pulp Expires: 01/17/2042 Consumed: 1 Quantity: 1 Sla: ContractNumber: Provided products: katello> system unsubscribe --org ACME_Corporation --name dhcp193-78.pnq.redhat.com --entitlement 8ac1490f35138547013514c8ce10003f Successfully unsubscribed System [ dhcp193-78.pnq.redhat.com ] Unsubscribing the system with serial cert id is also a success: ====================================================== katello> system subscriptions --org ACME_Corporation --name dhcp193-78.pnq.redhat.com ---------------------------------------------------------------------------------------------- Current Subscriptions for System [ dhcp193-78.pnq.redhat.com ] ---------------------------------------------------------------------------------------------- EntitlementId: 8ac1490f35138547013514be662b003b Serial Id: 3219094884821188044 PoolName: pulp Expires: 01/17/2042 Consumed: 1 Quantity: 1 Sla: ContractNumber: Provided products: katello> system unsubscribe --org ACME_Corporation --name dhcp193-78.pnq.redhat.com --serial 3219094884821188044 Successfully unsubscribed System [ dhcp193-78.pnq.redhat.com ]