Bug 1913311
| Summary: | hammer host list --help shows unusable name for IP field | ||
|---|---|---|---|
| Product: | Red Hat Satellite | Reporter: | Francesco Ratto <fratto> |
| Component: | Hosts | Assignee: | Oleh Fedorenko <ofedoren> |
| Status: | CLOSED ERRATA | QA Contact: | tstrych |
| Severity: | low | Docs Contact: | |
| Priority: | medium | ||
| Version: | 6.7.0 | CC: | apatel, inecas, kgaikwad, ofedoren, rabajaj, saydas |
| Target Milestone: | 6.10.0 | Keywords: | Triaged |
| Target Release: | Unused | ||
| Hardware: | Unspecified | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | tfm-rubygem-hammer_cli-2.5.1 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2021-11-16 14:09:38 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
Francesco Ratto
2021-01-06 13:42:43 UTC
Hello Francesco, I've tried the same command and got few points to this issue: 1. Organization field is being shown as expected, it's not missing. Probably could be misspelled. 2. IP should be spelled in lower-case or capitalized. Upper-case is reserved for field sets. 3. Environment should be typed correctly (as per table in help output), i.e. Lifecycle Environment. Please, could you try those points and give feedback if this helps? # hammer --csv host list --fields 'Name,Ip,Organization,Lifecycle Environment,Operating System,Security,Bugfix,Enhancement' --search "hypervisor = false" ** Replaced IP with Ip ** Replace Environment with Lifecycle Environment This works fine for me and prints the information i need on my test satellite. I am clearing the needinfo for Fransesco as comment 2, solves the issue for CU. Now, here's what I think should be fixed. # hammer --csv host list --help | grep "^ FIELDS" -A18 FIELDS | ALL | DEFAULT | THIN -----------------------|-----|---------|----- Id | x | x | x Name | x | x | x Operating System | x | x | Host Group | x | x | IP | x | x | --------------> This should be "Ip" but not "IP" 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 | -----------------------|-----|---------|----- Is it possible to get all these fields tested and properly mentioned in the --help section so that there is no confusion present with what to use ? -- Sayan Hi Sayan, Since everything works, I'd suggest to change the subject to a different issue or close this one. Also, I agree on improving help section since there were misunderstandings before. Probably we could use this BZ to track the help improvement. (In reply to Oleh Fedorenko from comment #4) > Hi Sayan, > > Since everything works, I'd suggest to change the subject to a different > issue or close this one. > > Also, I agree on improving help section since there were misunderstandings > before. Probably we could use this BZ to track the help improvement. I have changed the subject to make it more meaningful as per the current discussion we are having. Let me know if that looks ok to you. I think we can use this BZ now to track and fix the --help section . -- Sayan Hi everyone and thanks to quick reaction to my bz I would highligt a few other differences before , with hammer csv the line used to generate the report was hammer csv content-hosts --export --columns "Name,Organization,Environment,Virtual,OS,Arch,Sockets,RAM,Cores,Security Errata,Bug Fix Errata,Enhancement Errata" --search $something now is (do not consider the different fields like ip) # hammer --csv host list --fields 'Name,Ip,Organization,Lifecycle Environment,Operating System,Security,Bugfix,Enhancement' --search $something In old (and in current) version the clause 'environment' is present in --help but is now replaced by Lifecycle Environment and it seems not generating any output Are these clauses to be used with the initials capitalized ? Which are still effective ? This will be greatly useful to give the customer to create the most identical possible report and improve consistency between documentation .It would be also useful to have a sort of conversion table between the two versions since it looks they are different not only for the csv --> --csv option activation_key string activation_key_id string addon string addons_status Values: mismatched, matched, not_specified ansible_role string applicable_errata string applicable_rpms string architecture string autoheal boolean boot_time build Values: true, false class string comment text compute_resource string compute_resource_id integer config_group string content_source string content_view string content_view_id integer created_at datetime domain string domain_id integer environment string errata_status Values: security_needed, errata_needed, updated, unknown execution_status Values: ok, error facts string global_status Values: ok, warning, error has_ip string has_mac string hostgroup string hostgroup_fullname string hostgroup_id integer hostgroup_name string hostgroup_title string hypervisor Values: true, false hypervisor_host string image string installable_errata string installed_at datetime ip string job_invocation.id string job_invocation.result Values: cancelled, failed, pending, success last_checkin datetime last_report datetime lifecycle_environment string lifecycle_environment_id integer location string location_id integer mac string managed Values: true, false model string name string organization string organization_id integer origin string os string os_description string os_id integer os_major string os_minor string os_title string owner string owner_id integer owner_type string params string params_name string parent_hostgroup string puppet_ca string puppet_proxy_id integer puppetmaster string purpose_status Values: mismatched, matched, not_specified realm string realm_id integer registered_at datetime registered_through string release_version string role text role_status Values: mismatched, matched, not_specified service_level string sla_status Values: mismatched, matched, not_specified smart_proxy string status.applied integer status.enabled Values: true, false status.failed integer status.failed_restarts integer status.interesting Values: true, false status.pending integer status.restarted integer status.skipped integer subnet string subnet.name text subnet6 string subnet6.name text subscription_id string subscription_name string subscription_status Values: valid, partial, invalid, unknown, unsubscribed_hypervisor subscription_uuid string trace_status Values: reboot_needed, process_restart_needed, updated upgradable_rpms string usage text usage_status Values: mismatched, matched, not_specified user.firstname string user.lastname string user.login string user.mail string usergroup string usergroup.name string uuid string Many Thanks Francesco Hello Francesco, The "hammer csv" and "hammer --csv" are two entirely different commands. And for "hammer csv" there was a entire different module present earlier which was provided by "tfm-rubygem-hammer_cli_csv" but that has been discontinued now. So you cannot expect to exact same fields to be available in "hammer csv content-hosts" and "hammer --csv hosts list" . As far as I know, The "hammer csv content-hosts" has been discontinued as we have now introduced report templates and that can generate exact same details much faster on Satellite 6.8 [ Sat 6.7 still has some limitations ]. I hope this helps. -- Sayan Created redmine issue https://projects.theforeman.org/issues/32444 from this bug Upstream bug assigned to ofedoren Upstream bug assigned to ofedoren Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/32444 has been resolved. 1.) all other search fields except boot_time have the type, or values that should be expected, I think boot_time also should have it
# hammer host list --help
<omitted>
Search / Order fields:
<omitted>
architecture string
autoheal boolean
boot_time --------------------------------> missing type
<omitted>
2.)
IP field is working now, but it seems that no other fields except Id,Name,IP,MAC,Organization,Location are working.
I put all options to the command, ( I found --output=csv is same thins as --csv)
hammer -v --output=csv host list --fields="activation_key,activation_key_id,addon,addons_status,ansible_role,applicable_errata,applicable_errata_issued,applicable_rpms,architecture,autoheal,boot_time,build,class,comment,compute_resource,compute_resource_id,config_group,content_source,content_view,content_view_id,created_at,cve_id,domain,domain_id,environment,errata_status,execution_status,facts,global_status,has_ip,has_mac,hostgroup,hostgroup_fullname,hostgroup_id,hostgroup_name,hostgroup_title,hypervisor,hypervisor_host,id,image,insights_recommendations_count,installable_errata,installed_at,ip,job_invocation.id,job_invocation.result,last_checkin,last_report,lifecycle_environment,lifecycle_environment_id,location,location_id,mac,managed,model,name,organization,organization_id,origin,os,os_description,os_id,os_major,os_minor,os_title,owner,owner_id,owner_type,params,params_name,parent_hostgroup,puppet_ca,puppet_proxy_id,puppetmaster,purpose_status,realm,realm_id,registered_at,registered_through,release_version,role,role_status,service_level,sla_status,smart_proxy,status.applied,status.enabled,status.failed,status.failed_restarts,status.interesting,status.pending,status.restarted,status.skipped,subnet,subnet.name,subnet6,subnet6.name,subscription_id,subscription_name,subscription_status,subscription_uuid,trace_status,upgradable_rpms,usage,usage_status,user.firstname,user.lastname,user.login,user.mail,usergroup,usergroup.name,uuid" --per-page="10000"'
Result:
Id,Name,IP,MAC,Organization,Location
1,<hostname>,<ip>,56:6f:0d:72:0b:87,Default Organization,Default Location
2,<hostname>,<ip>,56:6f:0d:72:0c:a9,Default Organization,Default Location
3,zyoquaqn.fwvmv1x1iu,,64:40:8b:f3:73:03,CbgmBOhSdQo,aVrNbAsttM
I was thinking if it can be caused that there is no other info, or there is maximum of fields that can be used
As you can see host 3 has no ip address and yet is written there. So I would expect as host 3 has subnet (based on command below), the field of subnet should be in the result.
hammer host info --id 3 | grep Subnet
Subnet ipv4: ZHmHUNUUgwOK
I tried also only two fields id and subnet, doesn't work
hammer --csv host list --fields 'id,subnet'
Id
1
2
3
tried capital S, and subnet name -> same results as above only id is shown
hammer --csv host list --fields 'id,Subnet'
hammer --csv host list --fields 'id,subnet.name'
Please let me know what do you thing about it.
1) This should be handled in a separate BZ since some changes in the upstream [1] will add more fields with "empty" types. 2) You're mixing up the *output* fields with *search / order* fields. --fields option accepts *output* fields only when --search/--order accept only *search / order* fields. [1] - https://github.com/theforeman/foreman/pull/8524 Verified with sat 6.10 snap 5. All fields are now lowercase. (shown in table below) Search of specified fields where first character is upper and rest is lower work as expected. Also completely lowercase strings works as well. hammer --csv host list --fields=Id,Ip,Mac Id,IP,MAC 1,10.1.3.127,56:6f:0d:72:0b:87 2,10.1.3.80,56:6f:0d:72:0c:a9 3,,64:40:8b:f3:73:03 The upper case IP and MAC is still shown in output text, but I think that is not part of this BZ and I hope that this fact is not important. If it is please do not hesitate to comment this BZ. 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 | -----------------------|-----|---------|----- The package version on 6.10 snap 5 is tfm-rubygem-hammer_cli-2.5.1-1.el7sat.noarch. (newer than version with fix) 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 (Moderate: Satellite 6.10 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-2021:4702 |