Bug 2231258 - hammer host list does not print custom parameters even if they are present in the fields list. [NEEDINFO]
Summary: hammer host list does not print custom parameters even if they are present in...
Keywords:
Status: NEW
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hosts
Version: 6.11.0
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Satellite QE Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-08-11 06:37 UTC by Vedashree Deshpande
Modified: 2023-08-15 09:37 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:
Embargoed:
aruzicka: needinfo? (vdeshpan)


Attachments (Terms of Use)

Description Vedashree Deshpande 2023-08-11 06:37:44 UTC
Description of problem:
hammer host list or hammer --csv host list does not adhere to the fields passed and do not print the correct result. 

Version-Release number of selected component (if applicable):
Satellite 6.11 onward

How reproducible:
every time. Easy. 

Actual results:
# hammer host list --fields 'Name,Subscription Status,OS,Environment,Content View,Registered,Last Checkin'
-------------------------------|--------------------------
NAME                           | CONTENT VIEW
-------------------------------|--------------------------
host.example.com               | Default Organization View

But the below command works: 
# hammer host list --fields 'Id,Name,Operating System,Ip,Global Status,Content View,Lifecycle environment,Security,Bugf
---|--------------------------------|------------------|----------------|---------------|---------------------------|-----------------------|----------|--------|------------
ID | NAME                           | OPERATING SYSTEM | IP             | GLOBAL STATUS | CONTENT VIEW              | LIFECYCLE ENVIRONMENT | SECURITY | BUGFIX | ENHANCEMENT
---|--------------------------------|------------------|----------------|---------------|---------------------------|-----------------------|----------|--------|------------
52 | host.example.com          | RedHat 8.5       | 10.0.2.15      | Warning       | Default Organization View | Library               | 0        | 0      | 0


However, below fails too:

# hammer --csv host list --fields 'Name,Subscription Status,OS,Environment,Content View,Registered,Last Checkin'
Name,Content View
host.example.com,Default Organization View

Expected results:
It should print all the passed parameters with the command. 

Additional info:

Comment 1 Adam Ruzicka 2023-08-15 09:37:22 UTC
> hammer host list --fields 'Name,Subscription Status,OS,Environment,Content View,Registered,Last Checkin'

If you run hammer host list --help, it shows you which fields it can show, and as far as I know only the fields in "Predefined field sets" can be shown.

From my machine
Predefined field sets:                         
  -----------------------|-----|---------|-----
  FIELDS                 | ALL | DEFAULT | THIN 
  -----------------------|-----|---------|-----
  Id                     | x   | x       | x  
  Name                   | x   | x       | x    
  Operating system       | x   | x       |                                                      
  Host group             | x   | x       |               
  Ip                     | x   | x       |     
  Mac                    | x   | x       |                                                      
  Global status          | x   | x       |               
  Organization           | x   |         |    
  Location               | x   |         |                        
  Additional information | x   |         |    
  Content view           | x   | x       |                 
  Lifecycle environment  | x   | x       |     
  Security               | x   |         |    
  Bugfix                 | x   |         |    
  Enhancement            | x   |         |                                        
  Trace status           | x   | x       |    
  -----------------------|-----|---------|-----

Most of the fields you're passing in are not in that list. Yes, you can pass in literally anything, but hammer will not understand you. I don't see us adding support for allowing to show every single possible field anytime soon. If you really need all those details, I'd suggest putting together a report template which, when used to generate a report, would give you all the bits and pieces you might want to see. Would that be an option for you?

> Satellite 6.11 onward

As in this used to work on 6.10 and older?


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