Bug 1829701 - update the help description of hammer subscription list command for the --fields option to be more explicit
Summary: update the help description of hammer subscription list command for the --fie...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer
Version: 6.7.0
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: 6.10.0
Assignee: Amit Upadhye
QA Contact: Cole Higgins
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-04-30 07:03 UTC by Vladimír Sedmík
Modified: 2022-01-14 15:08 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-16 14:39:05 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 29732 0 Normal Closed update the help description of hammer subscription list command for the --fields option to be more explicit 2021-01-28 09:32:27 UTC
Red Hat Product Errata RHBA-2021:4701 0 None None None 2021-11-16 14:39:12 UTC

Description Vladimír Sedmík 2020-04-30 07:03:01 UTC
Description of problem:
hammer subscription list does not show ID and UUID if requested via --fields option

[root@dhcp-2-31 ~]# hammer subscription list --fields "ID,UUID,Name,Type"
----------------------------------------------|---------
NAME                                          | TYPE    
----------------------------------------------|---------
Red Hat Beta Access                           | Physical
Red Hat Enterprise Linux High Touch Beta      | Physical
Red Hat Satellite Employee Subscription       | Physical
Red Hat Satellite Infrastructure Subscription | Physical
----------------------------------------------|---------

[root@dhcp-2-31 ~]# hammer subscription list --help
Usage:
    hammer subscription list [OPTIONS]

Options:
...
 --fields FIELDS                         Show specified fileds or predefined filed sets only. (See below)
                                         Comma separated list of values. Values containing comma should be quoted or escaped with backslash.
                                         JSON is acceptable and preferred way for complex parameters
...
Predefined field sets:
  -----------|-----|--------
  FIELDS     | ALL | DEFAULT
  -----------|-----|--------
  ID         | x   | x
  UUID       | x   | x
  Name       | x   | x
  Type       | x   | x
  Contract   | x   | x
  Account    | x   | x
  Support    | x   | x
  Start Date | x   | x
  End Date   | x   | x
  Quantity   | x   | x
  Consumed   | x   | x
  -----------|-----|--------


Version-Release number of selected component (if applicable):
Satellite 6.7.0
tfm-rubygem-hammer_cli-0.19.2.1-1.el7sat.noarch

How reproducible:
always

Steps to Reproduce:
1. hammer subscription list --fields "ID,UUID,Name,Type"

Actual results:
ID and UUID is not listed

Expected results:
ID and UUID being listed

Additional info:

Comment 3 Oleh Fedorenko 2020-05-05 11:25:16 UTC
Hi Vladimír,

Actually this works, but probably not how would you expect. To specify fields with --field option you need to specify them in lowercase or capitalized, so
> hammer subscription list --fields "id,uuid,Name,Type"
will work.

Upcase is reserved for field sets such as ALL, DEFAULT, etc.

Comment 4 Vladimír Sedmík 2020-05-07 13:55:59 UTC
Hello Oleh,

yes, you are right, lowercase or capitals work fine. I just went exactly according to the help description. Perhaps we could update the description to avoid confusion and resolve this.

Thank you,
Vlad.

Comment 5 Oleh Fedorenko 2020-05-07 13:59:15 UTC
I guess we could update the description for commands such as info and list to be more explicit with --field option arguments.

Could you please change the title/description of the bug, so I'll create a redmine issue from this?

Comment 6 Vladimír Sedmík 2020-05-07 15:11:04 UTC
Title changed and set the DocType, as appropriate change should be also done in [1].

[1] https://access.redhat.com/documentation/en-us/red_hat_satellite/6.7/html/hammer_cli_guide/reference#hammer-subscription-list

Comment 7 Oleh Fedorenko 2020-05-11 13:54:59 UTC
Created redmine issue https://projects.theforeman.org/issues/29732 from this bug

Comment 8 Stephen Wadeley 2020-05-18 09:23:25 UTC
(In reply to Vladimír Sedmík from comment #6)
> Title changed and set the DocType, as appropriate change should be also done
> in [1].
> 
> [1]
> https://access.redhat.com/documentation/en-us/red_hat_satellite/6.7/html/
> hammer_cli_guide/reference#hammer-subscription-list

Hi

that part of the guide is created by a script. So once hammer is fixed, ask docs team to regenerate the guide.

adding spetrosi to c.c. for awareness

Thank you

Comment 9 Bryan Kearney 2020-12-02 16:03:58 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/29732 has been resolved.

Comment 16 errata-xmlrpc 2021-11-16 14:39:05 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 (Satellite 6.10 Satellite Tools Release), 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-2021:4701


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