Project

General

Profile

Bug #19996

Keys in JSON output has inconsistent capitalization

Added by Tomáš Strachota over 1 year ago. Updated 6 months ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
Hammer core
Target version:
-
Difficulty:
Triaged:
Bugzilla link:
Pull request:
Team Backlog:
Marek
Fixed in Releases:
Found in Releases:

Description

Create/update/delete commands print downcase keys (it's how they come from the API) while info/list print use first letter capital (field names from output definition). The capitalization should be consistent to enable easier scripting of "find or create" actions (often used in ansible).

For example:

architecture_json=$(hammer --output=json architecture info --name i386 2>/dev/null || hammer --output=json architecture create --name i386)

Typical current output of a create action:

hammer --output=json architecture create --name i386
{
  "message": "Architecture created",
  "id": 3,
  "name": "i386" 
}

Typical current output of an info action:

hammer --output=json architecture info --name i386
{
  "Id": 3,
  "Name": "i386",
  "Operating systems": [

  ],
  "Created at": "2017-06-13 13:29:28 UTC",
  "Updated at": "2017-06-13 13:29:28 UTC" 
}


Related issues

Related to Hammer CLI - Tracker #2823: Tracker for usability issuesNew2013-07-24

Related to Hammer CLI - Tracker #14914: Tracker for output related issuesNew2016-05-03

Is duplicate of Hammer CLI - Bug #17010: Hammer JSON output uses inconsistent capitalizationClosed

History

#1 Updated by Tomáš Strachota over 1 year ago

#2 Updated by Tomáš Strachota over 1 year ago

#3 Updated by Tomáš Strachota over 1 year ago

I found out that json output from katello info/index commands return a third form "ID". We should make this consistent as well.

#4 Updated by Tomáš Strachota about 1 year ago

  • Is duplicate of Bug #17010: Hammer JSON output uses inconsistent capitalization added

#5 Updated by Tomáš Strachota about 1 year ago

  • Status changed from New to Duplicate

Also available in: Atom PDF