diff --git a/novaclient/shell.py b/novaclient/shell.py index 1f182cc53..b4da9e2c6 100644 --- a/novaclient/shell.py +++ b/novaclient/shell.py @@ -592,8 +592,8 @@ class OpenStackComputeShell(object): metavar='<bypass-url>', dest='bypass_url', default=utils.env('NOVACLIENT_BYPASS_URL'), - help="Use this API endpoint instead of the Service Catalog. " - "Defaults to env[NOVACLIENT_BYPASS_URL].") + help=_("Use this API endpoint instead of the Service Catalog. " + "Defaults to env[NOVACLIENT_BYPASS_URL].")) parser.add_argument( '--bypass_url', action=DeprecatedAction, @@ -1046,7 +1046,7 @@ class OpenStackComputeShell(object): 'command', metavar='<subcommand>', nargs='?', - help='Display help for <subcommand>.') + help=_('Display help for <subcommand>.')) def do_help(self, args): """ Display help about this program or one of its subcommands. @@ -1080,13 +1080,13 @@ def main(): OpenStackComputeShell().main(argv) except Exception as exc: logger.debug(exc, exc_info=1) - print("ERROR (%s): %s" - % (exc.__class__.__name__, - encodeutils.exception_to_unicode(exc)), + print(_("ERROR (%(type)s): %(msg)s") % { + 'type': exc.__class__.__name__, + 'msg': encodeutils.exception_to_unicode(exc)}, file=sys.stderr) sys.exit(1) except KeyboardInterrupt: - print("... terminating nova client", file=sys.stderr) + print(_("... terminating nova client"), file=sys.stderr) sys.exit(130) diff --git a/novaclient/v2/shell.py b/novaclient/v2/shell.py index 95b892d89..3f97d6185 100644 --- a/novaclient/v2/shell.py +++ b/novaclient/v2/shell.py @@ -748,18 +748,18 @@ def _print_flavor_list(flavors, show_extra_specs=False): dest='marker', metavar='<marker>', default=None, - help=('The last flavor ID of the previous page; displays list of flavors' - ' after "marker".')) + help=_('The last flavor ID of the previous page; displays list of flavors' + ' after "marker".')) @cliutils.arg( '--limit', dest='limit', metavar='<limit>', type=int, default=None, - help=("Maximum number of flavors to display. If limit == -1, all flavors " - "will be displayed. If limit is bigger than " - "'osapi_max_limit' option of Nova API, limit 'osapi_max_limit' will " - "be used instead.")) + help=_("Maximum number of flavors to display. If limit == -1, all flavors " + "will be displayed. If limit is bigger than 'osapi_max_limit' " + "option of Nova API, limit 'osapi_max_limit' will be used " + "instead.")) def do_flavor_list(cs, args): """Print a list of available 'flavors' (sizes of servers).""" if args.all: @@ -1439,26 +1439,26 @@ def do_image_delete(cs, args): '--sort', dest='sort', metavar='<key>[:<direction>]', - help=('Comma-separated list of sort keys and directions in the form' - ' of <key>[:<asc|desc>]. The direction defaults to descending if' - ' not specified.')) + help=_('Comma-separated list of sort keys and directions in the form ' + 'of <key>[:<asc|desc>]. The direction defaults to descending if ' + 'not specified.')) @cliutils.arg( '--marker', dest='marker', metavar='<marker>', default=None, - help=('The last server UUID of the previous page; displays list of servers' - ' after "marker".')) + help=_('The last server UUID of the previous page; displays list of ' + 'servers after "marker".')) @cliutils.arg( '--limit', dest='limit', metavar='<limit>', type=int, default=None, - help=("Maximum number of servers to display. If limit == -1, all servers " - "will be displayed. If limit is bigger than " - "'osapi_max_limit' option of Nova API, limit 'osapi_max_limit' will " - "be used instead.")) + help=_("Maximum number of servers to display. If limit == -1, all servers " + "will be displayed. If limit is bigger than 'osapi_max_limit' " + "option of Nova API, limit 'osapi_max_limit' will be used " + "instead.")) def do_list(cs, args): """List active servers.""" imageid = None