Actions
Bug #19996
closedKeys in JSON output has inconsistent capitalization
Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
Hammer core
Target version:
-
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" }
Actions