Bug 1100406

Summary: Added subscription to activationkey, can no longer list activation keys.
Product: Red Hat Satellite Reporter: Alex Krzos <akrzos>
Component: HammerAssignee: Tom McKay <tomckay>
Status: CLOSED CURRENTRELEASE QA Contact: sthirugn <sthirugn>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.0.3CC: bbuckingham, jmontleo, mmccune, omaciel, sthirugn, tomckay
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/5888
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-02 14:07:30 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 Alex Krzos 2014-05-22 18:43:23 UTC
Description of problem:
I created an activation key and added a subscription.  I can no longer list or display information about said activation key.

Version-Release number of selected component (if applicable):
Snap5-Compose4:


How reproducible:
Always

Steps to Reproduce:
1. Upload manifest
2. create activation key
3. add subscription
4. attempt to list/info activation key
# hammer subscription upload --file manifest-100000-MCT1027.zip --organization-id 1
[..................................................................................................................................................................................................................................................] [100%]
Task aa53908c-002e-46ab-ae09-af990c1706f6: success
# hammer activation-key create --name perf-ak-1 --organization-id 1
Activation key created
# hammer activation-key list --organization-id 1
---|-----------|----------------|-----------------------|-------------
ID | NAME      | CONSUMED       | LIFECYCLE ENVIRONMENT | CONTENT VIEW
---|-----------|----------------|-----------------------|-------------
1  | perf-ak-1 | 0 of Unlimited |                       |
---|-----------|----------------|-----------------------|-------------
# hammer subscription list --organization-id 1
...
# hammer activation-key add-subscription --id 1 --subscription-id 8a8c942946247059014624797c3a0042
Subscription added to activation key
# hammer activation-key list --organization-id 1
undefined method `key?' for #<JSON::Ext::Generator::State:0x00000009db2c58>
# hammer activation-key list --organization-id 1
undefined method `key?' for #<JSON::Ext::Generator::State:0x00000009e42e20>
#  hammer activation-key info --id 1
undefined method `key?' for #<JSON::Ext::Generator::State:0x0000000979c580>
# hammer activation-key subscriptions --id 1
---------------------------------|--------------------------------------------------------------
ID                               | NAME
---------------------------------|--------------------------------------------------------------
8a8c942946247059014624797c3a0042 | Red Hat Enterprise Linux, Basic (up to 2 sockets for Hosting)
---------------------------------|--------------------------------------------------------------

Actual results:
# hammer -v activation-key list --organization-id 1
[ERROR 2014-05-22 14:32:53 API] 500 Internal Server Error
{
            "errors" => [
        [0] "undefined method `key?' for #<JSON::Ext::Generator::State:0x00000009eae9e0>"
    ],
    "displayMessage" => "undefined method `key?' for #<JSON::Ext::Generator::State:0x00000009eae9e0>"
}
[ERROR 2014-05-22 14:32:53 Exception] undefined method `key?' for #<JSON::Ext::Generator::State:0x00000009eae9e0>
undefined method `key?' for #<JSON::Ext::Generator::State:0x00000009eae9e0>
[ERROR 2014-05-22 14:32:53 Exception]

RestClient::InternalServerError (500 Internal Server Error):
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/abstract_response.rb:48:in `return!'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/request.rb:230:in `process_result'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/request.rb:178:in `transmit'
    /usr/lib/ruby/1.8/net/http.rb:543:in `start'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/request.rb:172:in `transmit'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/request.rb:64:in `execute'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/request.rb:33:in `execute'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/resource.rb:54:in `get'
    /usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.8/lib/apipie_bindings/api.rb:195:in `send'
    /usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.8/lib/apipie_bindings/api.rb:195:in `http_call'
    /usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.8/lib/apipie_bindings/api.rb:151:in `call'
    /usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.8/lib/apipie_bindings/resource.rb:14:in `call'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.0/lib/hammer_cli/./apipie/command.rb:42:in `send_request'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.0/lib/hammer_cli_foreman/commands.rb:112:in `send_request'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.0/lib/hammer_cli_foreman/commands.rb:139:in `send_request'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.0/lib/hammer_cli_foreman/commands.rb:185:in `retrieve_and_print'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.0/lib/hammer_cli_foreman/commands.rb:172:in `browse_collection'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.0/lib/hammer_cli_foreman/commands.rb:157:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.0/lib/hammer_cli/./apipie/../abstract.rb:22:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.0/lib/hammer_cli/./apipie/../abstract.rb:22:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.0/lib/hammer_cli/./apipie/../abstract.rb:22:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:125:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.0/bin/hammer:100
    /usr/bin/hammer:19:in `load'
    /usr/bin/hammer:19

Expected results:
List/info on activation keys

Additional info:
Can list subscriptions on the activation key after the fact.

Comment 1 RHEL Program Management 2014-05-22 18:45:17 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 2 Alex Krzos 2014-05-22 18:46:11 UTC
Version-Release number of selected component (if applicable):
Snap5-Compose4:
rubygem-hammer_cli_foreman-0.1.0-13.el6sat.noarch
rubygem-hammer_cli_katello-0.0.3-24.el6sat.noarch
rubygem-hammer_cli-0.1.0-13.el6sat.noarch
rubygem-hammer_cli_foreman_tasks-0.0.2-6.el6sat.noarch
candlepin-0.9.7-1.el6_5.noarch
katello-1.5.0-24.el6sat.noarch
pulp-server-2.4.0-0.18.beta.el6sat.noarch
foreman-1.6.0.9-1.el6sat.noarch

Comment 5 Brad Buckingham 2014-05-22 20:14:41 UTC
Created redmine issue http://projects.theforeman.org/issues/5888 from this bug

Comment 7 Tom McKay 2014-06-17 11:42:29 UTC
Overlap of other BZs; will be available in next snap.

Comment 9 sthirugn@redhat.com 2014-06-19 03:35:33 UTC
Verified.

# hammer activation-key create --name='testak' --organization-id=1
Activation key created

# hammer subscription upload --file /tmp/manifest.zip --organization-id=1
[............................................................] [100%]
Task e9f51ea3-20e6-44b1-b30a-2d650a3f6bd3: success

# hammer activation-key add-subscription --id=4 --subscription-id=8a90e0f146b091a50146b22ce42a018f
Subscription added to activation key

# hammer activation-key list --organization-id=1
---|------------|----------------|-----------------------|-------------
ID | NAME       | CONSUMED       | LIFECYCLE ENVIRONMENT | CONTENT VIEW
---|------------|----------------|-----------------------|-------------
2  | ack2       | 0 of Unlimited | DEV                   | cv1         
1  | ack500     | 1 of Unlimited | DEV                   | cv1         
4  | testak     | 0 of Unlimited |                       |             
3  | actkey1000 | 0 of Unlimited | DEV                   | cv1         
---|------------|----------------|-----------------------|-------------

Version Tested:
* apr-util-ldap-1.3.9-3.el6_0.1.x86_64
* candlepin-0.9.19-1.el6_5.noarch
* candlepin-scl-1-5.el6_4.noarch
* candlepin-scl-quartz-2.1.5-5.el6_4.noarch
* candlepin-scl-rhino-1.7R3-1.el6_4.noarch
* candlepin-scl-runtime-1-5.el6_4.noarch
* candlepin-selinux-0.9.19-1.el6_5.noarch
* candlepin-tomcat6-0.9.19-1.el6_5.noarch
* elasticsearch-0.90.10-4.el6sat.noarch
* foreman-1.6.0.18-1.el6sat.noarch
* foreman-compute-1.6.0.18-1.el6sat.noarch
* foreman-gce-1.6.0.18-1.el6sat.noarch
* foreman-libvirt-1.6.0.18-1.el6sat.noarch
* foreman-ovirt-1.6.0.18-1.el6sat.noarch
* foreman-postgresql-1.6.0.18-1.el6sat.noarch
* foreman-proxy-1.6.0.8-1.el6sat.noarch
* foreman-selinux-1.6.0-4.el6sat.noarch
* foreman-vmware-1.6.0.18-1.el6sat.noarch
* katello-1.5.0-26.el6sat.noarch
* katello-ca-1.0-1.noarch
* katello-certs-tools-1.5.5-1.el6sat.noarch
* katello-installer-0.0.49-1.el6sat.noarch
* openldap-2.4.23-32.el6_4.1.x86_64
* openldap-devel-2.4.23-32.el6_4.1.x86_64
* pulp-katello-0.3-3.el6sat.noarch
* pulp-nodes-common-2.4.0-0.21.beta.el6sat.noarch
* pulp-nodes-parent-2.4.0-0.21.beta.el6sat.noarch
* pulp-puppet-plugins-2.4.0-0.21.beta.el6sat.noarch
* pulp-puppet-tools-2.4.0-0.21.beta.el6sat.noarch
* pulp-rpm-plugins-2.4.0-0.21.beta.el6sat.noarch
* pulp-selinux-2.4.0-0.21.beta.el6sat.noarch
* pulp-server-2.4.0-0.21.beta.el6sat.noarch
* python-ldap-2.3.10-1.el6.x86_64
* ruby193-rubygem-net-ldap-0.3.1-3.el6sat.noarch
* ruby193-rubygem-runcible-1.1.0-2.el6sat.noarch

Comment 10 Bryan Kearney 2014-07-02 14:07:30 UTC
This was delivered with 6.0.3, which is the Satellite 6 Beta.