Bug 1283793 - Help JSON output should be truly JSON formatted
Help JSON output should be truly JSON formatted
Status: CLOSED WONTFIX
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Hammer (Show other bugs)
6.1.4
Unspecified Unspecified
unspecified Severity medium (vote)
: Unspecified
: --
Assigned To: satellite6-bugs
jcallaha
http://projects.theforeman.org/issues...
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-19 16:56 EST by jcallaha
Modified: 2017-01-11 16:47 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-01-11 16:47:48 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)


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 12589 None None None 2016-04-22 12:26 EDT

  None (edit)
Description jcallaha 2015-11-19 16:56:20 EST
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 11:17:59 EST
Created redmine issue http://projects.theforeman.org/issues/12589 from this bug
Comment 2 Bryan Kearney 2016-07-26 15:09:59 EDT
Moving 6.2 bugs out to sat-backlog.
Comment 3 Bryan Kearney 2017-01-11 16:47:48 EST
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.