Bug 1100198

Summary: `hammer subscription list` is not consistent when you use --organization or --organization-id
Product: Red Hat Satellite Reporter: Jan Hutař <jhutar>
Component: APIAssignee: Dustin Tsang <dtsang>
Status: CLOSED CURRENTRELEASE QA Contact: Kedar Bidarkar <kbidarka>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: NightlyCC: bbuckingham, bkearney, jmontleo, kbidarka, mmccune
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/5889
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-02 14:05:29 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 Jan Hutař 2014-05-22 08:53:13 UTC
Description of problem:
Command `hammer subscription list` is not consistent when you use --organization or --organization-id option.


Version-Release number of selected component (if applicable):
Satellite-6.0.3-RHEL-6-20140521.0


How reproducible:
always


Steps to Reproduce:
1. Create some products in your Sat6
2. # hammer subscription list --organization ACME_Corporation
   missing param 'system_id' in parameters
3. # hammer subscription list --organization-id 1
-----|----------|---------|---------|-----------|----------|------------|----------------------------------|---------|-----------|---------
NAME | CONTRACT | ACCOUNT | SUPPORT | QUANTITY  | CONSUMED | END DATE   | ID                               | PRODUCT | QUANTITY  | ATTACHED
-----|----------|---------|---------|-----------|----------|------------|----------------------------------|---------|-----------|---------
RHEL |          |         |         | Unlimited | 0        | 2044-05-13 | <hash>                     | RHEL    | Unlimited | 0       
Sat6 |          |         |         | Unlimited | 0        | 2044-05-13 | <hash>                     | Sat6    | Unlimited | 0       
-----|----------|---------|---------|-----------|----------|------------|----------------------------------|---------|-----------|---------


Actual results:
Behavior of the tool differs based on which option from --organization or --organization-id you choose


Expected results:
Behavior should match or should be documented


Additional info:
# hammer subscription list -h
Usage:
    hammer subscription list [OPTIONS]

Options:
    --activation-key ACTIVATION_KEY_NAME  
    --activation-key-id ACTIVATION_KEY_ID Activation key ID
    --organization ORGANIZATION_NAME  
    --organization-id ORGANIZATION_ID Organization ID
    --organization-label ORGANIZATION_LABEL  
    --system SYSTEM_NAME           
    --system-id SYSTEM_ID         UUID of the system
    -h, --help                    print help

Comment 2 Brad Buckingham 2014-05-22 20:36:57 UTC
Created redmine issue http://projects.theforeman.org/issues/5889 from this bug

Comment 3 Dustin Tsang 2014-06-06 21:07:23 UTC
seems to be ok in upstream now.

see output from upstream:
https://gist.github.com/dustint-rh/544820e89aa8cd2a9fb3

Comment 4 Dustin Tsang 2014-06-09 18:09:17 UTC
commits seem to be already part of Compose 8-2; No PRs associated.

Comment 6 Kedar Bidarkar 2014-06-12 10:10:05 UTC
verified with sat6-snap9

[root@xxxxxxx ~]# hammer subscription list --organization ACME_Corporation
----------------------------------------------------------------------|----------|---------|----------|-----------|----------|------------|----------------------------------|-----------------------------------------------------------------------|-----------|---------
NAME                                                                  | CONTRACT | ACCOUNT | SUPPORT  | QUANTITY  | CONSUMED | END DATE   | ID                               | PRODUCT                                                               | QUANTITY  | ATTACHED
----------------------------------------------------------------------|----------|---------|----------|-----------|----------|------------|----------------------------------|-----------------------------------------------------------------------|-----------|---------
Red Hat Enterprise Linux Server, Standard (Physical or Virtual Nodes) | xxxxx | xxxxx | Standard | 5         | 0        | 2015-05-01 | xxxxx | Red Hat Enterprise Linux Server, Standard (Physical or Virtual Nodes) | 5         | 0       
Sat6                                                                  |          |         |          | Unlimited | 0        | 2044-06-04 | xxxxx | Sat6                                                                  | Unlimited | 0       
Sat6Tools                                                             |          |         |          | Unlimited | 0        | 2044-06-04 | xxxxxxx | Sat6Tools                                                             | Unlimited | 0       
----------------------------------------------------------------------|----------|---------|----------|-----------|----------|------------|----------------------------------|-----------------------------------------------------------------------|-----------|---------
[root@xxxxx ~]# hammer subscription list --organization-id 1
----------------------------------------------------------------------|----------|---------|----------|-----------|----------|------------|----------------------------------|-----------------------------------------------------------------------|-----------|---------
NAME                                                                  | CONTRACT | ACCOUNT | SUPPORT  | QUANTITY  | CONSUMED | END DATE   | ID                               | PRODUCT                                                               | QUANTITY  | ATTACHED
----------------------------------------------------------------------|----------|---------|----------|-----------|----------|------------|----------------------------------|-----------------------------------------------------------------------|-----------|---------
Red Hat Enterprise Linux Server, Standard (Physical or Virtual Nodes) | xxxxxx | xxxxxx | Standard | 5         | 0        | 2015-05-01 | xxxxxx| Red Hat Enterprise Linux Server, Standard (Physical or Virtual Nodes) | 5         | 0       
Sat6                                                                  |          |         |          | Unlimited | 0        | 2044-06-04 | xxxxxxxxxxxx | Sat6                                                                  | Unlimited | 0       
Sat6Tools                                                             |          |         |          | Unlimited | 0        | 2044-06-04 | xxxxxxxxxxxxxxxxx | Sat6Tools                                                             | Unlimited | 0       
----------------------------------------------------------------------|----------|---------|----------|-----------|----------|------------|----------------------------------|-----------------------------------------------------------------------|-----------|---------



Installed Packages

    candlepin-0.9.7-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.7-1.el6_5.noarch
    candlepin-tomcat6-0.9.7-1.el6_5.noarch
    createrepo-0.9.9-21.2.pulp.el6sat.noarch
    dhcp207-55.lab.eng.pnq.redhat.com-qpid-broker-1.0-1.noarch
    dhcp207-55.lab.eng.pnq.redhat.com-qpid-client-cert-1.0-1.noarch
    elasticsearch-0.90.10-4.el6sat.noarch
    katello-1.5.0-25.el6sat.noarch
    katello-ca-1.0-1.noarch
    katello-certs-tools-1.5.5-1.el6sat.noarch
    katello-installer-0.0.48-1.el6sat.noarch
    m2crypto-0.21.1.pulp-10.el6sat.x86_64
    mod_wsgi-3.4-1.pulp.el6sat.x86_64
    pulp-katello-0.3-3.el6sat.noarch
    pulp-nodes-common-2.4.0-0.20.beta.el6sat.noarch
    pulp-nodes-parent-2.4.0-0.20.beta.el6sat.noarch
    pulp-puppet-plugins-2.4.0-0.20.beta.el6sat.noarch
    pulp-puppet-tools-2.4.0-0.20.beta.el6sat.noarch
    pulp-rpm-plugins-2.4.0-0.20.beta.el6sat.noarch
    pulp-selinux-2.4.0-0.20.beta.el6sat.noarch
    pulp-server-2.4.0-0.20.beta.el6sat.noarch
    python-gofer-qpid-1.2.1-1.el6sat.noarch
    python-isodate-0.5.0-1.pulp.el6sat.noarch
    python-kombu-3.0.15-10.pulp.el6sat.noarch
    python-pulp-bindings-2.4.0-0.20.beta.el6sat.noarch
    python-pulp-common-2.4.0-0.20.beta.el6sat.noarch
    python-pulp-puppet-common-2.4.0-0.20.beta.el6sat.noarch
    python-pulp-rpm-common-2.4.0-0.20.beta.el6sat.noarch
    python-qpid-0.22-14.el6sat.noarch
    python-qpid-qmf-0.22-31.el6sat.x86_64
    qpid-cpp-client-0.22-40.el6.x86_64
    qpid-cpp-server-0.22-40.el6.x86_64
    qpid-cpp-server-linearstore-0.22-40.el6.x86_64
    qpid-proton-c-0.7-1.el6.x86_64
    qpid-qmf-0.22-31.el6sat.x86_64
    qpid-tools-0.22-12.el6.noarch
    ruby193-rubygem-katello-1.5.0-57.el6sat.noarch
    rubygem-hammer_cli_katello-0.0.4-6.el6sat.noarch

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