Description of problem: The customer would like to add the field related to errata on "hammer host list" Version-Release number of selected component (if applicable): 6.5.z How reproducible: 100% Steps to Reproduce: 1. Install an errata or update a bulk of content hosts 2. Generate a report about those servers Actual results: We don't have a way to do that. Expected results: "hammer host list" showing errata info Additional info:
Hello all Below a great workaround // The command based on host-collection --- for b in $(hammer --csv host-collection hosts --name "rh_test" --organization ACME | grep -v ^ID | cut -d, -f2); do name=$b; count=$(hammer --csv host errata list --host $b | grep -v ^ID | wc -l); echo "$name,$count"; done --- // Example Output --- # for b in $(hammer --csv host-collection hosts --name "rh_test" --organization ACME | grep -v ^ID | cut -d, -f2); do name=$b; count=$(hammer --csv host errata list --host $b | grep -v ^ID | wc -l); echo "$name,$count"; done kate-piedra.local.domain,0 --- // The command based on ALL hosts registered on Satellite --- for b in $(hammer --csv host list --organization ACME | grep -v -E '(^Id|virt-who)' | cut -d, -f2); do name=$b; count=$(hammer --csv host errata list --host $b | grep -v ^ID | wc -l); echo "$name,$count"; done | tee /tmp/server_list.log // Example Output --- # for b in $(hammer --csv host list --organization ACME | grep -v -E '(^Id|virt-who)' | cut -d, -f2); do name=$b; count=$(hammer --csv host errata list --host $b | grep -v ^ID | wc -l); echo "$name,$count"; done | tee /tmp/server_list.log heath-derion.local.domain,344 kate-piedra.local.domain,0 --- Best Regards -- Waldirio M Pinheiro | Senior Software Maintenance Engineer
Please use the reporting tools which were delivered with 6.5.
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/27094 has been resolved.
The predefined field group names should be case-insensitive (I used --fields all and then spent ~20mins trying to figure out, what's the proper usage, as this was giving me an empty result). If the predefined sets are not going to change, added, etc. i see no reason why not including their names directly inside --fields option help message: " --fields FIELDS|ALL|THIN " Overall, I like this enhancement and i'd probably make it global (for other sub-commands too).
Hi Roman, I don't believe this one should be failedQA. The enhancement that Waldirio provided was to expand the output of the 'host list' command to include errata counts. The failure raised is on the --fields parameter which is a separate feature that applies to all hammer commands (as far as I can tell). The concern raised in comment 7 is valid; however, it should be captured in a separate bugzilla on the hammer component. Do you agree?
(In reply to Brad Buckingham from comment #8) > Hi Roman, > > I don't believe this one should be failedQA. > > The enhancement that Waldirio provided was to expand the output of the 'host > list' command to include errata counts. > > The failure raised is on the --fields parameter which is a separate feature > that applies to all hammer commands (as far as I can tell). The concern > raised in comment 7 is valid; however, it should be captured in a separate > bugzilla on the hammer component. > > Do you agree? I see. In that case the FailedQA stands even stronger, as by default there are no such fields in the `hammer host list` output: ``` # hammer host list ---|------------------------------------|------------------|------------|------------|-------------------|---------------|---------------------------|---------------------- ID | NAME | OPERATING SYSTEM | HOST GROUP | IP | MAC | GLOBAL STATUS | CONTENT VIEW | LIFECYCLE ENVIRONMENT ---|------------------------------------|------------------|------------|------------|-------------------|---------------|---------------------------|---------------------- 3 | demo1.rplevka.com | RedHat 7.7 | hg1 | 10.1.4.13 | 56:6f:0d:72:05:9a | OK | Default Organization View | Library 1 | dhcp-2-20.vms.sat.rdu2.redhat.com | RedHat 7.7 | | 10.1.2.20 | 56:6f:0d:72:05:54 | Warning | | 2 | dhcp-3-218.vms.sat.rdu2.redhat.com | RedHat 7.7 | | 10.1.3.218 | 56:6f:0d:72:05:cb | OK | | ---|------------------------------------|------------------|------------|------------|-------------------|---------------|---------------------------|---------------------- ``` it was the `--fields` option which added the expanded output: ``` # hammer host list --fields ALL ---|------------------------------------|------------------|------------|------------|-------------------|---------------|----------------------|------------------|------------------------|---------------------------|-----------------------|----------|--------|------------ ID | NAME | OPERATING SYSTEM | HOST GROUP | IP | MAC | GLOBAL STATUS | ORGANIZATION | LOCATION | ADDITIONAL INFORMATION | CONTENT VIEW | LIFECYCLE ENVIRONMENT | SECURITY | BUGFIX | ENHANCEMENT ---|------------------------------------|------------------|------------|------------|-------------------|---------------|----------------------|------------------|------------------------|---------------------------|-----------------------|----------|--------|------------ 3 | demo1.rplevka.com | RedHat 7.7 | hg1 | 10.1.4.13 | 56:6f:0d:72:05:9a | OK | nH0ONj | Default Location | | Default Organization View | Library | 0 | 0 | 0 1 | dhcp-2-20.vms.sat.rdu2.redhat.com | RedHat 7.7 | | 10.1.2.20 | 56:6f:0d:72:05:54 | Warning | Default Organization | Default Location | | | | | | 2 | dhcp-3-218.vms.sat.rdu2.redhat.com | RedHat 7.7 | | 10.1.3.218 | 56:6f:0d:72:05:cb | OK | Default Organization | Default Location | | | | | | ---|------------------------------------|------------------|------------|------------|-------------------|---------------|----------------------|------------------|------------------------|---------------------------|-----------------------|----------|--------|------------ ```
Hello On Satellite 6.7 beta, I can see the description as below on "hammer host list --help" --- [root@wallsat67 ~]# hammer host list --help Usage: hammer host list [OPTIONS] Options: --environment ENVIRONMENT_NAME Environment name (--environment is deprecated: Use --puppet-environment instead) --environment-id ENVIRONMENT_ID (--environment-id is deprecated: Use --puppet-environment-id instead) --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 --hostgroup HOSTGROUP_NAME Hostgroup name --hostgroup-id HOSTGROUP_ID --hostgroup-title HOSTGROUP_TITLE Hostgroup title --location LOCATION_NAME Location name --location-id LOCATION_ID --location-title LOCATION_TITLE Location title --order ORDER Sort field and order, eg. ‘id DESC’ --organization ORGANIZATION_NAME Organization name --organization-id ORGANIZATION_ID Organization ID --organization-title ORGANIZATION_TITLE Organization title --page PAGE Page number, starting at 1 --per-page PER_PAGE Number of results per page to return --puppet-environment PUPPET_ENVIRONMENT_NAME Puppet environment name --puppet-environment-id PUPPET_ENVIRONMENT_ID --search SEARCH Filter results --thin THIN Only list ID and name of hosts One of true/false, yes/no, 1/0. -h, --help Print help 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 | | -----------------------|-----|---------|----- --- which explains which field should be visible when using --fields flag. Please, let us know if it makes sense to you. Waldirio
Upstream bug assigned to wpinheir
(In reply to Brad Buckingham from comment #8) > Hi Roman, > > I don't believe this one should be failedQA. > > The enhancement that Waldirio provided was to expand the output of the 'host > list' command to include errata counts. > > The failure raised is on the --fields parameter which is a separate feature > that applies to all hammer commands (as far as I can tell). The concern > raised in comment 7 is valid; however, it should be captured in a separate > bugzilla on the hammer component. > Hello I had some issues testing with --fields Bug 1836391 - hammer erratum list --fields does not work for all fields but was referred to: Bug 1829701 - update the help description of hammer subscription list command for the --fields option to be more explicit
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 (Important: Satellite 6.8 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/RHSA-2020:4366