Bug 1283793 - Help JSON output should be truly JSON formatted
Summary: Help JSON output should be truly JSON formatted
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer
Version: 6.1.4
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: jcallaha
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-19 21:56 UTC by jcallaha
Modified: 2017-01-11 21:47 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-01-11 21:47:48 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 12589 0 None None None 2016-04-22 16:26:14 UTC

Description jcallaha 2015-11-19 21:56:20 UTC
Description of problem:
If a user request JSON-formatted help output from hammer, they are given all useful information as one large string within one "message" tag. The user would then have to parse that string to separate the useful information. If the output was already separated into a true JSON format, no additional processing would be needed and is already very useful.

Version-Release number of selected component (if applicable):
Nightly

How reproducible:
Always

Steps to Reproduce:
1. hammer --output=json host --help

Actual results:
{
  "message": "Usage:\n    hammer host [OPTIONS] SUBCOMMAND [ARG] ...\n\nParameters:\n SUBCOMMAND                    subcommand\n [ARG] ...                     subcommand arguments\n\nSubcommands:\n create                        Create a host\n delete                        Delete a host\n delete-parameter              Delete parameter for a host.\n facts                         List all fact values\n info                          Show a host\n interface                     View and manage host's network interfaces\n list                          List all hosts\n puppet-classes                List all Puppet classes\n puppetrun                     Force a Puppet agent run on the host\n reboot                        Reboot a host\n reports                       List all reports\n sc-params                     List all smart class parameters\n set-parameter                 Create or update parameter for a host.\n smart-variables               List all smart variables\n start                         Power a host on\n status                        Get configuration status of host\n stop                          Power a host off\n update                        Update a host\n\nOptions:\n -h, --help                    print help\n"
}

Expected results:
Something like
{
    "Usage": "hammer host [OPTIONS] SUBCOMMAND [ARG] ...",
    "Parameters": {
        "SUBCOMMAND": "subcommand",
        "[ARG] ...": "subcommand arguments"
    },
    "Subcommands": {
        "create": "Create a host",
        "delete": "Delete a host",
        "delete-parameter": "Delete parameter for a host.",
        "facts": "List all fact values",
        "info": "Show a host",
        "interface": "View and manage host's network interfaces",
        "list": "List all hosts",
        "puppet-classes": "List all Puppet classes",
        "puppetrun": "Force a Puppet agent run on the host",
        "reboot": "Reboot a host",
        "reports": "List all reports",
        "sc-params": "List all smart class parameters",
        "set-parameter": "Create or update parameter for a host.",
        "smart-variables": "List all smart variables",
        "start": "Power a host on",
        "status": "Get configuration status of host",
        "stop": "Power a host off",
        "update": "Update a host"
    }
}

Comment 1 Bryan Kearney 2015-11-24 16:17:59 UTC
Created redmine issue http://projects.theforeman.org/issues/12589 from this bug

Comment 2 Bryan Kearney 2016-07-26 19:09:59 UTC
Moving 6.2 bugs out to sat-backlog.

Comment 3 Bryan Kearney 2017-01-11 21:47:48 UTC
This is an older bug which has been reported upstream. We are not going to track this bug downstream. When the upstream issue is resolved, the next build will contain the fix. Thank you.


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