Bug 1255164

Summary: Hammer JSON output does not give as much information back during create as CSV
Product: Red Hat Satellite Reporter: jcallaha
Component: HammerAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED CURRENTRELEASE QA Contact: jcallaha
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.1.0CC: bkearney, tstrachota
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-01-05 13:31:42 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 jcallaha 2015-08-19 19:59:36 UTC
Description of problem:
A user requesting CSV output while creating an object in hammer will be given a message, ID, and Name. However, users performing the same action, but requesting JSON output only get a message.

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

How reproducible:
always

Steps to Reproduce:
1. run hammer --output=json organization create --name="fqNjmb"
2. view results

Actual results:
[root@rhsm-qe-1 ~]# hammer -v -u admin -p ****** --output=json organization create --name="fqNjmb"
Organization created

[root@rhsm-qe-1 ~]# hammer -v -u admin -p ****** --output=csv organization create --name="fqNjmc"
Message,Id,Name
Organization created,43,fqNjmc


Expected results:
[root@rhsm-qe-1 ~]# hammer -v -u admin -p ****** --output=json organization create --name="fqNjmb"
{
   'message': 'Organization created',
   'id': 42,
   'name': 'fqNjmb'
}

[root@rhsm-qe-1 ~]# hammer -v -u admin -p ****** --output=csv organization create --name="fqNjmc"
Message,Id,Name
Organization created,43,fqNjmc


Additional info:
It would be fantastic if [1] was kept in mind when fixing this bug.
[1] - https://bugzilla.redhat.com/show_bug.cgi?id=1253820

Comment 3 Bryan Kearney 2016-08-04 20:10:36 UTC
Moving 6.2 bugs out to sat-backlog.

Comment 5 Tomas Strachota 2016-11-09 13:35:53 UTC
Fixed in satellite 6.2.3

hammer (0.5.1.11)
 * hammer_cli_csv (unknown version)
 * hammer_cli_foreman (0.5.1.9)
 * hammer_cli_foreman_admin (0.0.5)
 * hammer_cli_foreman_bootdisk (0.1.3.3)
 * hammer_cli_foreman_discovery (0.0.2.3)
 * hammer_cli_foreman_docker (unknown version)
 * hammer_cli_foreman_remote_execution (unknown version)
 * hammer_cli_foreman_tasks (unknown version)
 * hammer_cli_import (0.11.2)
 * hammer_cli_katello (0.0.22.26)


[root@sat62 ~]# hammer --output=json organization create --name="fqNjmb"
{
  "message": "Organization created",
  "id": 4,
  "name": "fqNjmb"
}
[root@sat62 ~]# hammer --output=csv organization create --name="fqNjma"
Message,Id,Name
Organization created,5,fqNjma