Bug 835591 - activation-key --limit not working
Summary: activation-key --limit not working
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: API
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: Lukas Zapletal
QA Contact: Og Maciel
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-06-26 14:33 UTC by Garik Khachikyan
Modified: 2019-09-26 15:53 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
The --limit option of the `katello activation_key` command reported an error when used. This fix sets the --limit option to accept integer values. The error no longer appears.
Clone Of:
Environment:
Last Closed: 2012-12-04 19:46:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2012:1543 0 normal SHIPPED_LIVE Important: CloudForms System Engine 1.1 update 2012-12-05 00:39:57 UTC

Description Garik Khachikyan 2012-06-26 14:33:30 UTC
Description of problem:
invoking: `activation_key create --name test --org ACME_Corporation --environment dev --limit 1` fails with exception:
---
Wrong/Invalid parameters sent for api/activation_keys/create.
 Wrong Parameters: 
[{"activation_key"=>["usage_limit"]}]
 Parameters Received:
 {"activation_key"=>{"usage_limit"=>"1", "description"=>nil, "name"=>"test"}, "action"=>"create", "controller"=>"api/activation_keys", "environment_id"=>"7"}
---

Version-Release number of selected component (if applicable):
Recent Katello:
--
pulp-common-1.1.10-1.el6.noarch
qpid-cpp-server-ssl-0.14-14.el6_2.x86_64
katello-glue-candlepin-0.2.41-1.git.23.9a2ef30.el6.noarch
katello-repos-testing-0.2.4-1.el6.noarch
pulp-1.1.10-1.el6.noarch
katello-configure-0.2.27-1.git.1.039c665.el6.noarch
candlepin-tomcat6-0.5.32-1.el6.noarch
katello-qpid-broker-key-pair-1.0-1.noarch
katello-cli-common-0.2.41-1.git.0.6ef074b.el6.noarch
katello-cli-0.2.41-1.git.0.6ef074b.el6.noarch
m2crypto-0.21.1.pulp-7.el6.x86_64
mod_wsgi-3.3-3.pulp.el6.x86_64
python-qpid-0.14-7.el6_2.noarch
qpid-cpp-client-ssl-0.14-14.el6_2.x86_64
katello-glue-pulp-0.2.41-1.git.23.9a2ef30.el6.noarch
pulp-selinux-server-1.1.10-1.el6.noarch
katello-qpid-client-key-pair-1.0-1.noarch
katello-agent-1.0.3-1.git.0.cccd0b4.el6.noarch
candlepin-0.5.32-1.el6.noarch
qpid-cpp-server-0.14-14.el6_2.x86_64
katello-glue-foreman-0.2.41-1.git.23.9a2ef30.el6.noarch
katello-0.2.41-1.git.23.9a2ef30.el6.noarch
katello-candlepin-cert-key-pair-1.0-1.noarch
python-oauth2-1.5.170-2.pulp.el6.noarch
katello-certs-tools-1.1.6-1.git.0.4878f30.el6.noarch
qpid-cpp-client-0.14-14.el6_2.x86_64
katello-common-0.2.41-1.git.23.9a2ef30.el6.noarch
katello-repos-0.2.4-1.el6.noarch
katello-selinux-0.2.5-1.git.0.cc457ee.el6.noarch
--

How reproducible:
always

Steps to Reproduce:
1.just prepare org, env.
2.invoke command in description
3.
  
Actual results:
failure

Expected results:
no failure. the AK with usage limit specified should get prepared.

Additional info:

Comment 1 Lukas Zapletal 2012-06-26 16:10:09 UTC
Is this testing build or stable build?

Comment 2 Garik Khachikyan 2012-06-27 11:15:33 UTC
it's (actually was) yesterday's Katello built right from github (not fedorahosted).

Comment 3 Lukas Zapletal 2012-06-27 14:14:08 UTC
[root@zone ~]# kk activation_key create --name test --org ACME_Corporation --environment dev --limit 1
Successfully created activation key [ test ]

[root@zone ~]# versions
katello-0.2.42-1.git.9.fc18833.el6.noarch
katello-cli-0.2.41-1.git.0.6ef074b.el6.noarch
katello-agent-1.0.3-1.git.0.cccd0b4.el6.noarch
pulp-1.1.10-1.el6.noarch
candlepin-0.5.32-1.el6.noarch
subscription-manager-0.99.14-1.el6.x86_64
python-rhsm-0.99.8-1.el6.noarch
yum-3.2.29-22.el6.noarch

Most likely old katello package.

katello-0.2.41-1.git.23.9a2ef30.el6.noarch
VS
katello-0.2.42-1.git.9.fc18833.el6.noarch

Can you please try with recent nightly or git?

Comment 4 Lukas Zapletal 2012-06-27 14:14:59 UTC
The next nightly should work Garik, please retest and close if not valid. Thanks.

Comment 6 Garik Khachikyan 2012-07-02 13:11:30 UTC
this particular issue now works, but i have another one: 

value -1 works and then it allows system to be registered by that key. like:
---
Id:                 51
Name:               test2
Description:
    None
Usage:              1/-1
Environment Id:     85
System Template Id: None
---

I think would be better to have a check telling: >0

Comment 7 Lukas Zapletal 2012-07-04 08:28:59 UTC
Yeah -1 means unlimited, I am going to hide this from the CLI. It should be hidden.

Comment 8 Garik Khachikyan 2012-08-30 07:54:42 UTC
qe-acking

Comment 9 Lukas Zapletal 2012-09-04 12:17:58 UTC
https://github.com/Katello/katello/pull/576

Comment 11 Og Maciel 2012-10-04 21:39:28 UTC
# katello -u admin -p admin activation_key create --name test --org "Tupinambá" --environment Mild --limit 1
Successfully created activation key [ test ]

Comment 12 Og Maciel 2012-10-04 21:40:37 UTC
Verified using:

* candlepin-0.7.8-1.el6cf.noarch
* candlepin-selinux-0.7.8-1.el6cf.noarch
* candlepin-tomcat6-0.7.8-1.el6cf.noarch
* katello-1.1.12-12.el6cf.noarch
* katello-all-1.1.12-12.el6cf.noarch
* katello-candlepin-cert-key-pair-1.0-1.noarch
* katello-certs-tools-1.1.8-1.el6cf.noarch
* katello-cli-1.1.8-6.el6cf.noarch
* katello-cli-common-1.1.8-6.el6cf.noarch
* katello-common-1.1.12-12.el6cf.noarch
* katello-configure-1.1.9-6.el6cf.noarch
* katello-glue-candlepin-1.1.12-12.el6cf.noarch
* katello-glue-pulp-1.1.12-12.el6cf.noarch
* katello-qpid-broker-key-pair-1.0-1.noarch
* katello-qpid-client-key-pair-1.0-1.noarch
* katello-selinux-1.1.1-1.el6cf.noarch
* pulp-1.1.12-1.el6cf.noarch
* pulp-common-1.1.12-1.el6cf.noarch
* pulp-selinux-server-1.1.12-1.el6cf.noarch

Comment 14 errata-xmlrpc 2012-12-04 19:46:56 UTC
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/RHSA-2012-1543.html


Note You need to log in before you can comment on or make changes to this bug.