Project

General

Profile

Actions

Bug #38405

open

Hammer command with --csv option generates few fields in json format

Added by Quinn James 2 days ago. Updated 1 day ago.

Status:
Ready For Testing
Priority:
Normal
Assignee:
Category:
Hammer
Target version:
Difficulty:
medium
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

Cloned from https://issues.redhat.com/browse/SAT-22589

Description of problem:
----------------------

When hammer command is used with --csv option to output the data in a single field, for some reason, certain fields are formatted as JSON rather than a single field.

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

Red Hat Satellite 6.14

How reproducible:
----------------

Always (easy).

Steps to Reproduce:
------------------

1. host=myhost.example.com

2. # hammer --csv host info --name "$host" --fields "Name,Content Information/Content view environments/Content view/Name,Content Information/Content view environments/Lifecycle environment/
Name,Host Collections/Name,Host Group,Operating system/Operating System"

Actual results:
--------------

Name,Host Group,Operating system::Operating System,Content view environments::Content view::1,Content view environments::Lifecycle environment::1
myhost.example.com,,RedHat 9.2,"

{""id""=>3, ""name""=>""RHEL8"", ""composite""=>false}","{""id""=>1, ""name""=>""Library""}"

Expected results:
----------------

The above output should have each field as a single field, and not some in json format

Additional info:
---------------

- This looks like a regression bug from Satellite Server 6.13 into 6.14, as it works as expected in 6.13, but fails in 6.14.

- Following are the results from my lab Satellite Servers. Both from 6.13, and from 6.14 -

1. Red Hat Satellite 6.13
---------------------

[root@rhsat613 ~]# host=dhcp130-106.example.com

[root@rhsat613 ~]# hammer --csv host info --name "$host" --fields "Name,Content Information/Content view environments/Content view/Name,Content Information/Content view environments/Lifecycle environment/
Name,Host Collections/Name,Host Group,Operating system/Operating System"

Name,Host Group,Operating system::Operating System
dhcp130-106.example.com,Test_HG,RedHat 7.9

2. Red Hat Satellite 6.14
---------------------

[root@rhsat614 ~]# host=dhcp130-165.example.com

[root@rhsat614 ~]# hammer --csv host info --name "$host" --fields "Name,Content Information/Content view environments/Content view/Name,Content Information/Content view environments/Lifecycle environment/Name,Host Collections/Name,Host Group,Operating system/Operating System"

Name,Host Group,Operating system::Operating System,Content view environments::Content view::1,Content view environments::Lifecycle environment::1
dhcp130-165.example.com,,RedHat 9.2,"{""id""=>3, ""name""=>""RHEL8"", ""composite""=>false}
","

{""id""=>1, ""name""=>""Library""}
"

Actions #1

Updated by The Foreman Bot 2 days ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/hammer-cli-katello/pull/994 added
Actions #2

Updated by Lucy Fu 1 day ago

  • Category set to Hammer
  • Triaged changed from No to Yes
Actions

Also available in: Atom PDF