Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1122924 - hammer do not show subscriptions I want to add to activation key
Summary: hammer do not show subscriptions I want to add to activation key
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer
Version: 6.0.3
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: Dustin Tsang
QA Contact: jcallaha
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-24 12:11 UTC by Jan Hutař
Modified: 2017-02-23 21:10 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-20 18:31:59 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 6942 0 None None None 2016-04-22 16:11:52 UTC
Red Hat Product Errata RHBA-2015:0247 0 normal SHIPPED_LIVE Red Hat Satellite 6 server bug fix update 2015-02-20 23:30:44 UTC

Description Jan Hutař 2014-07-24 12:11:00 UTC
Description of problem:
hammer do not show subscriptions I want to add to my activation key. Says "no Data" although I see these in webUI with "Default_Organization" selected.


Version-Release number of selected component (if applicable):
Satellite-6.0.4-RHEL-6-20140723.0


How reproducible:
Hammer do not show subscriptions I want to add to activation key


Steps to Reproduce:
1. I have satellite with 2 custom products created
2. I have created new activation key:
   # hammer --username <user> --password <pass> \
       activation-key create --content-view-id MyContentView \
       --name MyActivationKey --organization "Default_Organization"
3. List all the subscriptions you can attach to the activation key
   # hammer --username <user> --password <pass> \
       subscription list --organization-id 1


Actual results:
No data.

When I add these product subscriptions via webUI (where I can see them: Content -> Activation Keys -> MyActivationKey -> Subscriptions -> Add) hammer then lists them:

# hammer --username <user> --password <pass> activation-key subscriptions --id 1
---------------------------------|-----
ID                               | NAME
---------------------------------|-----
8a90c1364765d6fc014767fa3df10012 | RHEL
8a90c1364765d6fc014767f98fe6000b | Sat6
---------------------------------|-----


Expected results:
Should list subscriptions for mine 2 products.


Additional info:
# hammer --debug --username <user> --password <pass> subscription list --organization-id 1
[ INFO 2014-07-24 07:45:19 Init] Initialization of Hammer CLI (0.1.1) has started...
[DEBUG 2014-07-24 07:45:19 Init] Running at ruby 1.8.7-p352
[ INFO 2014-07-24 07:45:19 Init] Configuration from the file /etc/hammer/cli_config.yml has been loaded
[ INFO 2014-07-24 07:45:19 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman.yml has been loaded
[ INFO 2014-07-24 07:45:19 Init] Configuration from the file /etc/hammer/cli.modules.d/katello.yml has been loaded
[DEBUG 2014-07-24 07:45:19 Connection] Registered: foreman
[DEBUG 2014-07-24 07:45:19 API] Global headers: {
    "Accept-Language" => "en",
        :content_type => "application/json",
              :accept => "application/json;version=2"
}
[ INFO 2014-07-24 07:45:21 HammerCLI::MainCommand] subcommand organization (HammerCLIForeman::Organization) was removed.
[ INFO 2014-07-24 07:45:21 HammerCLI::MainCommand] subcommand organization (HammerCLIKatello::Organization) was created.
[ INFO 2014-07-24 07:45:22 Modules] Extension module hammer_cli_katello (0.0.4) loaded
[ INFO 2014-07-24 07:45:22 Modules] Extension module hammer_cli_foreman (0.1.1) loaded
[DEBUG 2014-07-24 07:45:22 Init] Using locale 'en'
[DEBUG 2014-07-24 07:45:22 Init] 'mo' files for locale domain 'hammer-cli' loaded from '/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/locale'
[DEBUG 2014-07-24 07:45:22 Init] 'mo' files for locale domain 'hammer-cli-foreman' loaded from '/usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/locale'
[DEBUG 2014-07-24 07:45:22 Init] 'mo' files for locale domain 'hammer-cli-katello' loaded from '/usr/lib/ruby/gems/1.8/gems/hammer_cli_katello-0.0.4/locale'
[ INFO 2014-07-24 07:45:22 HammerCLI::MainCommand] Called with options: {"option_password"=>"***", "option_debug"=>true, "option_username"=>"admin"}
[ INFO 2014-07-24 07:45:22 HammerCLIKatello::SubscriptionCommand] Called with options: {}
[ INFO 2014-07-24 07:45:22 HammerCLIKatello::SubscriptionCommand::ListCommand] Called with options: {"option_organization_id"=>"1"}
[ INFO 2014-07-24 07:45:22 API] GET /katello/api/organizations/1/subscriptions
[DEBUG 2014-07-24 07:45:22 API] Params: {}
[DEBUG 2014-07-24 07:45:22 API] Headers: {
    :params => {}
}
[DEBUG 2014-07-24 07:45:22 API] Response {
       "total" => 0,
        "page" => 1,
    "per_page" => 20,
        "sort" => {
        "order" => nil,
           "by" => nil
    },
      "search" => nil,
     "results" => [],
    "subtotal" => 0
}
No data.

Comment 3 Dustin Tsang 2014-08-04 19:07:36 UTC
Tested using sat6-beta-post-compose2: 
Custom products display in `hammer subscription list` immediately after creating a custom yum product in the organization. 

please re-open if this is an issue in newer releases.

Comment 4 Jan Hutař 2014-08-05 09:26:39 UTC
Hello,
I have tried with Satellite-6.0.4-RHEL-6-20140730.0 and for some reason I do not see the product:

# hammer --username <user> --password <pass> subscription list --organization-id 1
-----|----------|---------|---------|-----------|----------|------------|----------------------------------|---------|-----------|---------
NAME | CONTRACT | ACCOUNT | SUPPORT | QUANTITY  | CONSUMED | END DATE   | ID                               | PRODUCT | QUANTITY  | ATTACHED
-----|----------|---------|---------|-----------|----------|------------|----------------------------------|---------|-----------|---------
sat6 |          |         |         | Unlimited | 0        | 2044-07-27 | 8a90c13647a0294c0147a24ad62701c4 | sat6    | Unlimited | 0       
-----|----------|---------|---------|-----------|----------|------------|----------------------------------|---------|-----------|---------
# hammer --username <user> --password <pass> product create --name FooBarBaz --organization-id 1
Product created
# hammer --username <user> --password <pass> subscription list --organization-id 1
-----|----------|---------|---------|-----------|----------|------------|----------------------------------|---------|-----------|---------
NAME | CONTRACT | ACCOUNT | SUPPORT | QUANTITY  | CONSUMED | END DATE   | ID                               | PRODUCT | QUANTITY  | ATTACHED
-----|----------|---------|---------|-----------|----------|------------|----------------------------------|---------|-----------|---------
sat6 |          |         |         | Unlimited | 0        | 2044-07-27 | 8a90c13647a0294c0147a24ad62701c4 | sat6    | Unlimited | 0       
-----|----------|---------|---------|-----------|----------|------------|----------------------------------|---------|-----------|---------

Any idea on what am I doing wrong?

Comment 6 Dustin Tsang 2014-08-05 18:52:00 UTC
Created redmine issue http://projects.theforeman.org/issues/6942 from this bug

Comment 7 Dustin Tsang 2014-08-05 19:12:12 UTC
Sorry Jan for missing it the first time. Subscriptions aren't being reindexed when subscriptions are being listed in the cli.

Comment 8 Jan Hutař 2014-08-05 21:38:08 UTC
I'm sure it worked some time ago. I have filled this because some automated test started to fail.

Comment 9 Jan Hutař 2014-08-18 08:18:01 UTC
Any progress here please? This blocks our libvirt compute resource automated testing.

Comment 10 jcallaha 2014-10-10 18:14:27 UTC
*** This bug is verified in upstream.  This fix should eventually land in future downstream builds ***

Verified in RHEL6/RHEL7

* candlepin-0.9.32-1.el7.noarch
* candlepin-common-1.0.8-1.el7.noarch
* candlepin-selinux-0.9.32-1.el7.noarch
* candlepin-tomcat-0.9.32-1.el7.noarch
* elasticsearch-0.90.10-7.el7.noarch
* foreman-1.7.0-0.develop.201410091913git35b6fb9.el7.noarch
* foreman-compute-1.7.0-0.develop.201410091913git35b6fb9.el7.noarch
* foreman-gce-1.7.0-0.develop.201410091913git35b6fb9.el7.noarch
* foreman-libvirt-1.7.0-0.develop.201410091913git35b6fb9.el7.noarch
* foreman-ovirt-1.7.0-0.develop.201410091913git35b6fb9.el7.noarch
* foreman-postgresql-1.7.0-0.develop.201410091913git35b6fb9.el7.noarch
* foreman-proxy-1.7.0-0.develop.201410081229git52f0bac.el7.noarch
* foreman-release-1.7.0-0.develop.201410091913git35b6fb9.el7.noarch
* foreman-selinux-1.7.0-0.develop.201409301113git2f345de.el7.noarch
* foreman-vmware-1.7.0-0.develop.201410091913git35b6fb9.el7.noarch
* katello-2.1.0-1.201410091752gitc9c45c1.el7.noarch
* katello-certs-tools-2.0.1-1.el7.noarch
* katello-default-ca-1.0-1.noarch
* katello-installer-2.1.0-1.201410021645git304e036.el7.noarch
* katello-repos-2.1.1-1.el7.noarch
* katello-server-ca-1.0-1.noarch
* openldap-2.4.39-3.el7.x86_64
* pulp-docker-plugins-0.2.1-0.2.beta.el7.noarch
* pulp-katello-0.3-3.el7.noarch
* pulp-nodes-common-2.5.0-0.7.beta.el7.noarch
* pulp-nodes-parent-2.5.0-0.7.beta.el7.noarch
* pulp-puppet-plugins-2.5.0-0.7.beta.el7.noarch
* pulp-puppet-tools-2.5.0-0.7.beta.el7.noarch
* pulp-rpm-plugins-2.5.0-0.7.beta.el7.noarch
* pulp-selinux-2.5.0-0.7.beta.el7.noarch
* pulp-server-2.5.0-0.7.beta.el7.noarch
* python-ldap-2.4.6-6.el7.x86_64
* ruby193-rubygem-ldap_fluff-0.3.1-1.el7.noarch
* ruby193-rubygem-net-ldap-0.3.1-2.el7.noarch
* ruby193-rubygem-runcible-1.2.0-1.el7.noarch
* rubygem-hammer_cli-0.1.3-1.201409240954gitf3c47c7.el7.noarch
* rubygem-hammer_cli_foreman-0.1.3-1.201409191432gitc38f9c8.el7.noarch
* rubygem-hammer_cli_foreman_tasks-0.0.3-2.201409091410git163c264.git.0.988ca80.el7.noarch
* rubygem-hammer_cli_import-0.10.4-1.el7.noarch
* rubygem-hammer_cli_katello-0.0.6-1.201410091836gitf7ca881.git.0.4d3b99d.el7.noarch

Comment 15 jaudet 2015-02-11 21:34:15 UTC
Verified according to the procedure outlined in Comment 0. Verified against four Satellite 6.0.8 applications, two of which are running on RHEL 6.6, and two of which are running on RHEL 7.0.

Comment 17 errata-xmlrpc 2015-02-20 18:31:59 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.

https://access.redhat.com/errata/RHBA-2015:0247


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