Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed the subcommand error message for nova shell.

Previously we were giving advice like this:

"Try 'nova volume-show help' for more information."

Bad advice -- that doesn't work. Now when there's a subcommand
specified we make a proper suggestion:

"Try 'nova help volume-show' for more information."

Change-Id: I6ef49f9e4e1b67074f51ab442abd4a196d437b00
  • Loading branch information...
commit 565d144611710ed7591244892a936549f91e9473 1 parent 9485608
Andrew Bogott authored

Showing 1 changed file with 6 additions and 2 deletions. Show diff stats Hide diff stats

  1. +6 2 novaclient/shell.py
8 novaclient/shell.py
@@ -55,8 +55,12 @@ def error(self, message):
55 55 self.print_usage(sys.stderr)
56 56 #FIXME(lzyeval): if changes occur in argparse.ArgParser._check_value
57 57 choose_from = ' (choose from'
58   - self.exit(2, "error: %s\nTry '%s help' for more information.\n" %
59   - (message.split(choose_from)[0], self.prog))
  58 + progparts = self.prog.partition(' ')
  59 + self.exit(2, "error: %(errmsg)s\nTry '%(mainp)s help %(subp)s'"
  60 + " for more information.\n" %
  61 + {'errmsg': message.split(choose_from)[0],
  62 + 'mainp': progparts[0],
  63 + 'subp': progparts[2]})
60 64
61 65
62 66 class OpenStackComputeShell(object):

0 comments on commit 565d144

Please sign in to comment.
Something went wrong with that request. Please try again.