Bug 612247
Summary: | subscribe to custom pool w/ custom product fails | ||
---|---|---|---|
Product: | [Community] Candlepin | Reporter: | wes hayutin <whayutin> |
Component: | candlepin | Assignee: | Adrian Likins <alikins> |
Status: | CLOSED WONTFIX | QA Contact: | wes hayutin <whayutin> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 0.5 | CC: | alikins, bkearney |
Target Milestone: | --- | Keywords: | Triaged |
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2013-04-16 20:18:37 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
wes hayutin
2010-07-07 16:33:41 UTC
Looks like the script is using product_name.hash for it's id. .hash can sometimes be negative, which is not valid for a product id (or at least not for a product that is going to have a subscription/pool created for it directly, since that product id will eventually end up in the x509 cert OID). Also, need to register as the user created in that script to be able to subscribe to that product. Updated script inline (also adds cli argument to specify the user/product/etc count) #!/usr/bin/ruby #require "../../../client/ruby/candlepin_api" require "candlepin_api" require 'pp' count = ARGV[0] puts count cp = Candlepin.new('admin', 'admin') puts 'Creating Owner' owner = cp.create_owner("owner_test#{count}") puts 'Creating User' user = cp.create_user(owner['id'], "user_test#{count}", 'dog8code') puts 'Creating Product' product = cp.create_product("product_test#{count}", "product_test#{count}".hash.abs) puts 'Creating Subscription' cp.create_subscription(owner['id'], product['id'], 3000000) cp.refresh_pools(owner['key']) Running that as ".that_script.rb 114" then sudo subscription-manager-cli register --username user_test114 --password dog8code --force then [adrian@alikins ruby]$ sudo subscription-manager-cli list --available d8a6fae2-fa89-4e5d-b252-838d43785b95 <connection.UEPConnection instance at 0x15c77e8> +-------------------------------------------+ Available Subscriptions +-------------------------------------------+ Name: product_test114 ProductId: 1131145341 PoolId: 17 quantity: 3000000 Expires: 2011-07-11 [adrian@alikins ruby]$ sudo subscription-manager-cli subscribe --pool 17 Seems to work. Serverside should probably be detecting that that is an invalid id for a "SVC" product (svc is the default in the ruby api) and complaining. |