Feature #18532

Better help for unsupported hammer commands

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

Status:Closed
Priority:Normal
Assigned To:Oleh Fedorenko
Category:Hammer core
Target version:Foreman - Team Marek backlog
Difficulty: Bugzilla link:
Found in release: Pull request:https://github.com/theforeman/hammer-cli/pull/257
Story points-
Velocity based estimate-

Description

Hammer commands which use api endpoints that are not defined on the server (eg. newer hammer executed against older Foreman) fail correctly when one tries to execute them, but they provide empty help. We can detect such situations from apidoc (documentation for the action is missing) and print some meaningful message instead.

Example with cloning user roles:

hammer role clone
Could not clone the user role:
  Error: The server does not support such operation.

Help prints empty options, which isn't very helpful:

hammer role clone -h
Usage:
    hammer role clone [OPTIONS]

Options:
 -h, --help                    print help

We should print some informative message instead:

hammer role clone -h
Usage:
    hammer role clone [OPTIONS]

Unfortunately the server does not support such operation.


Related issues

Related to Hammer CLI - Tracker #20605: Backward compatibility support New 08/15/2017

Associated revisions

Revision 768325dc
Added by Oleh Fedorenko 4 months ago

Fixes #18532 - Better help for unsupported hammer commands (#257)

History

#1 Updated by Tomáš Strachota 10 months ago

#2 Updated by Oleh Fedorenko 8 months ago

  • Assigned To set to Oleh Fedorenko
  • Status changed from New to Assigned

#3 Updated by The Foreman Bot 8 months ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/hammer-cli/pull/257 added

#4 Updated by Oleh Fedorenko 4 months ago

  • % Done changed from 0 to 100
  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF