Project

General

Profile

Actions

Bug #19996

closed

Keys in JSON output has inconsistent capitalization

Added by Tomáš Strachota almost 7 years ago. Updated almost 6 years ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
Hammer core
Target version:
-
Difficulty:
Triaged:
Team Backlog:
Marek
Fixed in Releases:
Found in Releases:
In Kanboard:

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 3 (0 open3 closed)

Related to Hammer CLI - Tracker #2823: Tracker for usability issuesClosed

Actions
Related to Hammer CLI - Tracker #14914: Tracker for output related issuesClosed

Actions
Is duplicate of Hammer CLI - Bug #17010: Hammer JSON output uses inconsistent capitalizationClosedOleh FedorenkoActions
Actions #1

Updated by Tomáš Strachota almost 7 years ago

Actions #2

Updated by Tomáš Strachota almost 7 years ago

Actions #3

Updated by Tomáš Strachota almost 7 years ago

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

Actions #4

Updated by Tomáš Strachota over 6 years ago

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

Updated by Tomáš Strachota over 6 years ago

  • Status changed from New to Duplicate
Actions

Also available in: Atom PDF