summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Górski <bartosz@codilime.com>2016-02-24 23:09:43 +0000
committerBartosz Górski <bartosz@codilime.com>2016-02-25 07:05:35 +0000
commite43c66a0aaf1609b0be5f931759aed0537b32b19 (patch)
tree1312217df0a2bc9d28c2069d1c16113f8d479316
parentca5b06f6ae9426eb20ee9e58022c49c219d4a067 (diff)
downloadpython-novaclient-e43c66a0aaf1609b0be5f931759aed0537b32b19.tar.gz
Adds missing internationalization for help message
Change-Id: I676daed583cac49f72593c79e9f79f7c9908a57c Related-Bug: #1491492 Signed-off-by: Bartosz Górski <bartosz@codilime.com>
-rw-r--r--novaclient/shell.py14
-rw-r--r--novaclient/v2/shell.py30
2 files changed, 22 insertions, 22 deletions
diff --git a/novaclient/shell.py b/novaclient/shell.py
index 1f182cc5..b4da9e2c 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 95b892d8..3f97d618 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