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 1082777 - [RFE] `hammer COMMAND ACTION --organization-id` should actually consume ID, or the option name should be changed
Summary: [RFE] `hammer COMMAND ACTION --organization-id` should actually consume ID, o...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer
Version: Nightly
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: Unspecified
Assignee: Adam Price
QA Contact: Tazim Kolhar
URL: http://projects.theforeman.org/issues...
Whiteboard:
: 1084927 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-03-31 19:43 UTC by Jan Hutař
Modified: 2019-09-26 18:17 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-07-02 14:05:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 5028 0 None None None 2016-04-22 16:41:36 UTC

Description Jan Hutař 2014-03-31 19:43:31 UTC
Description of problem:
`hammer subscription list --organization-id` is supposed to consume organization ID, but consumes organization LABEL


Version-Release number of selected component (if applicable):
rubygem-hammer_cli-0.1.0-4.el6sat.noarch


How reproducible:
always

Steps to Reproduce:
1. # hammer organization list
---|------------------|------------------|------------------------------
ID | NAME             | LABEL            | DESCRIPTION                  
---|------------------|------------------|------------------------------
1  | ACME_Corporation | ACME_Corporation | ACME_Corporation Organization
---|------------------|------------------|------------------------------
2. # hammer subscription list -h
Usage:
    hammer subscription list [OPTIONS]

Options:
    --activation-key-id ACTIVATION_KEY_ID Activation key ID
    --organization-id ORGANIZATION_ID Organization ID   <<< note this
    --system-id SYSTEM_ID         UUID of the system
    -h, --help                    print help
3. # hammer subscription list --organization-id 1
Couldn't find organization '1'
4. # hammer subscription list --organization-id ACME_Corporation
No data.


Actual results:
When you give organization ID, hammer claims "Couldn't find organization..."


Expected results:
Maybe option should be renamed to:

    --organization-label ORGANIZATION_LABEL Organization label

?

Comment 1 Jan Hutař 2014-03-31 19:45:45 UTC
Same for (have not checked others):

# hammer subscription upload --organization-id 1 --file /root/manifest.zip

Comment 2 RHEL Program Management 2014-03-31 19:54:52 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 4 Bryan Kearney 2014-04-02 14:17:30 UTC
Created redmine issue http://projects.theforeman.org/issues/5028 from this bug

Comment 6 Adam Price 2014-04-15 20:03:52 UTC
Jan,

the --organization-id option looking for LABEL is a much bigger problem than just `subscription list`. it's essentially application-wide because all apidoc says `organnization-id`. This needs to be changed for the whole app.

Comment 8 Brad Buckingham 2014-04-24 14:15:54 UTC
*** Bug 1084927 has been marked as a duplicate of this bug. ***

Comment 9 Adam Price 2014-05-01 15:12:25 UTC
https://github.com/Katello/katello/pull/4028

Comment 10 Adam Price 2014-05-09 14:29:47 UTC
also: https://github.com/Katello/hammer-cli-katello/pull/155

for the cli

Comment 12 Tazim Kolhar 2014-05-20 07:23:38 UTC
# hammer subscription list --organization-id 1
No data.

# hammer subscription list --organization-id ACME_Corporation
Couldn't find organization 'ACME_Corporation'

Comment 13 Adam Price 2014-05-27 17:17:32 UTC
Tazim,

How is this failing? passing `ACME_Corporation` to --organization-id is going to fail because `ACME_Corporation` is not the organization's ID.

correct:
--organzation-id 1
--organization-label ACME_Corporation
--organization-name ACME_Corporation

incorrect:
--organization-id ACME_Corporation

Comment 14 Tazim Kolhar 2014-06-02 14:45:50 UTC
VERIFIED


# hammer subscription list --organization-id 1
------------------------------|----------|---------|--------------|-----------|----------|------------|----------------------------------|-------------------------------|-----------|---------
NAME                          | CONTRACT | ACCOUNT | SUPPORT      | QUANTITY  | CONSUMED | END DATE   | ID                               | PRODUCT                       | QUANTITY  | ATTACHED
------------------------------|----------|---------|--------------|-----------|----------|------------|----------------------------------|-------------------------------|-----------|---------
test_prod                     |          |         |              | Unlimited | 0        | 2044-05-22 | 8aa2a4014649c53a01464da2af0b0098 | test_prod                     | Unlimited | 0       
Red Hat Employee Subscription | 10023298 | 477931  | SELF-SUPPORT | Unlimited | 0        | 2014-07-09 | 8aa2a40146445a93014645437e6301a3 | Red Hat Employee Subscription | Unlimited | 0       
Red Hat Employee Subscription | 10023298 | 477931  | SELF-SUPPORT | Unlimited | 0        | 2014-07-09 | 8aa2a4014649c53a01464dac838a00a3 | Red Hat Employee Subscription | Unlimited | 0       
Red Hat Employee Subscription | 10023298 | 477931  | SELF-SUPPORT | 5         | 2        | 2014-07-09 | 8aa2a40146445a93014644762b9300d2 | Red Hat Employee Subscription | 5         | 2       
------------------------------|----------|---------|--------------|-----------|----------|------------|----------------------------------|-------------------------------|-----------|---------

Comment 15 Tazim Kolhar 2014-06-02 14:57:09 UTC
Here we need to provide system-id as mandatory option
So here subscriptions are listed systemwise 

# hammer subscription list --organization ACME_Corporation --system-id ca084bdf-ad39-495e-9a40-793580936b3f
------------------------------|----------|---------|--------------|----------|----------|------------|----------------------------------|-------------------------------|----------|---------
NAME                          | CONTRACT | ACCOUNT | SUPPORT      | QUANTITY | CONSUMED | END DATE   | ID                               | PRODUCT                       | QUANTITY | ATTACHED
------------------------------|----------|---------|--------------|----------|----------|------------|----------------------------------|-------------------------------|----------|---------
Red Hat Employee Subscription | 10023298 | 477931  | SELF-SUPPORT | 5        | 2        | 2014-07-09 | 8aa2a40146445a93014645437e6101a2 | Red Hat Employee Subscription | 5        | 2       
------------------------------|----------|---------|--------------|----------|----------|------------|----------------------------------|-------------------------------|----------|---------


# hammer subscription list --organization-label ACME_Corporation --system-id ca084bdf-ad39-495e-9a40-793580936b3f
------------------------------|----------|---------|--------------|----------|----------|------------|----------------------------------|-------------------------------|----------|---------
NAME                          | CONTRACT | ACCOUNT | SUPPORT      | QUANTITY | CONSUMED | END DATE   | ID                               | PRODUCT                       | QUANTITY | ATTACHED
------------------------------|----------|---------|--------------|----------|----------|------------|----------------------------------|-------------------------------|----------|---------
Red Hat Employee Subscription | 10023298 | 477931  | SELF-SUPPORT | 5        | 2        | 2014-07-09 | 8aa2a40146445a93014645437e6101a2 | Red Hat Employee Subscription | 5        | 2       
------------------------------|----------|---------|--------------|----------|----------|------------|----------------------------------|-------------------------------|----------|---------

Comment 16 Adam Price 2014-06-02 15:06:05 UTC
tkolkar, i'm not sure what you're asking for in comment15 is within the scope of this bug.

if you think that's a bug, please discuss with us or file a new bug. thanks :)

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


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