Bug 1255164 - Hammer JSON output does not give as much information back during create as CSV
Hammer JSON output does not give as much information back during create as CSV
Status: CLOSED CURRENTRELEASE
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Hammer (Show other bugs)
6.1.0
Unspecified Unspecified
unspecified Severity medium (vote)
: Unspecified
: --
Assigned To: satellite6-bugs
jcallaha
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-19 15:59 EDT by jcallaha
Modified: 2018-01-05 08:31 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-01-05 08:31:42 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description jcallaha 2015-08-19 15:59:36 EDT
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 16:10:36 EDT
Moving 6.2 bugs out to sat-backlog.
Comment 5 Tomas Strachota 2016-11-09 08:35:53 EST
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

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