Improve the error message from the nova shell

Output 'nova help' on error rather than `nova'

Change-Id: I71c3fb6786472c42b0bfd93a085168ba75d37590
Old-Change-Id: I67360589a4af5697d3f90afa74b8504eefaf4976
This commit is contained in:
Pádraig Brady 2012-03-06 17:28:23 +00:00
parent 3d9a2284d3
commit 97953f52e1
2 changed files with 3 additions and 3 deletions

View File

@ -39,6 +39,7 @@ Matt Stephenson <mattstep@mattstep.net>
Michael Basnight <mbasnight@gmail.com>
Nicholas Mistry <nmistry@gmail.com>
Nikolay Sokolov <nsokolov@griddynamics.com>
Pádraig Brady <pbrady@redhat.com>
Pavel Shkitin <pshkitin@griddynamics.com>
Rick Harris <rconradharris@gmail.com>
Robie Basak <robie.basak@canonical.com>

View File

@ -55,9 +55,8 @@ class NovaClientArgumentParser(argparse.ArgumentParser):
self.print_usage(sys.stderr)
#FIXME(lzyeval): if changes occur in argparse.ArgParser._check_value
choose_from = ' (choose from'
self.exit(2, "error: %s\nTry `%s' for more information.\n" %
(message.split(choose_from)[0],
self.prog.replace(" ", " help ", 1)))
self.exit(2, "error: %s\nTry '%s help' for more information.\n" %
(message.split(choose_from)[0], self.prog))
class OpenStackComputeShell(object):