diff options
| author | Huanxuan Ao <huanxuan.ao@easystack.cn> | 2016-06-12 19:59:10 +0800 |
|---|---|---|
| committer | Dean Troyer <dtroyer@gmail.com> | 2016-06-14 11:03:56 -0500 |
| commit | f25a3519c525cd8f3ff04c841b63c10f640c27f6 (patch) | |
| tree | 9618055b28918d7bca63e2fad78e4351c8a4cc48 /openstackclient/shell.py | |
| parent | 769baf329e6aa619e7d9a5e48a5230bcf4399228 (diff) | |
| download | python-openstackclient-f25a3519c525cd8f3ff04c841b63c10f640c27f6.tar.gz | |
Fix missing i18n supports in api/ and shell.py
Change-Id: I28d79d7f44b27d2b600dedad2a3601180650ad83
Partial-bug: #1574965
Diffstat (limited to 'openstackclient/shell.py')
| -rw-r--r-- | openstackclient/shell.py | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/openstackclient/shell.py b/openstackclient/shell.py index a15e04dd..12a63af2 100644 --- a/openstackclient/shell.py +++ b/openstackclient/shell.py @@ -36,6 +36,7 @@ from oslo_utils import strutils import openstackclient from openstackclient.common import clientmanager from openstackclient.common import commandmanager +from openstackclient.i18n import _ from os_client_config import config as cloud_config @@ -63,9 +64,8 @@ def prompt_for_password(prompt=None): pass # No password because we did't have a tty or nothing was entered if not pw: - raise exc.CommandError( - "No password entered, or found via --os-password or OS_PASSWORD", - ) + raise exc.CommandError(_("No password entered, or found via" + " --os-password or OS_PASSWORD"),) return pw @@ -185,7 +185,7 @@ class OpenStackShell(app.App): metavar='<cloud-config-name>', dest='cloud', default=utils.env('OS_CLOUD'), - help='Cloud name in clouds.yaml (Env: OS_CLOUD)', + help=_('Cloud name in clouds.yaml (Env: OS_CLOUD)'), ) # Global arguments parser.add_argument( @@ -193,37 +193,41 @@ class OpenStackShell(app.App): metavar='<auth-region-name>', dest='region_name', default=utils.env('OS_REGION_NAME'), - help='Authentication region name (Env: OS_REGION_NAME)') + help=_('Authentication region name (Env: OS_REGION_NAME)'), + ) parser.add_argument( '--os-cacert', metavar='<ca-bundle-file>', dest='cacert', default=utils.env('OS_CACERT'), - help='CA certificate bundle file (Env: OS_CACERT)') + help=_('CA certificate bundle file (Env: OS_CACERT)'), + ) parser.add_argument( '--os-cert', metavar='<certificate-file>', dest='cert', default=utils.env('OS_CERT'), - help='Client certificate bundle file (Env: OS_CERT)') + help=_('Client certificate bundle file (Env: OS_CERT)'), + ) parser.add_argument( '--os-key', metavar='<key-file>', dest='key', default=utils.env('OS_KEY'), - help='Client certificate key file (Env: OS_KEY)') + help=_('Client certificate key file (Env: OS_KEY)'), + ) verify_group = parser.add_mutually_exclusive_group() verify_group.add_argument( '--verify', action='store_true', default=None, - help='Verify server certificate (default)', + help=_('Verify server certificate (default)'), ) verify_group.add_argument( '--insecure', action='store_true', default=None, - help='Disable server certificate verification', + help=_('Disable server certificate verification'), ) parser.add_argument( '--os-default-domain', @@ -232,28 +236,29 @@ class OpenStackShell(app.App): default=utils.env( 'OS_DEFAULT_DOMAIN', default=DEFAULT_DOMAIN), - help='Default domain ID, default=' + - DEFAULT_DOMAIN + - ' (Env: OS_DEFAULT_DOMAIN)') + help=_('Default domain ID, default=%s. ' + '(Env: OS_DEFAULT_DOMAIN)') % DEFAULT_DOMAIN, + ) parser.add_argument( '--os-interface', metavar='<interface>', dest='interface', choices=['admin', 'public', 'internal'], default=utils.env('OS_INTERFACE'), - help='Select an interface type.' - ' Valid interface types: [admin, public, internal].' - ' (Env: OS_INTERFACE)') + help=_('Select an interface type.' + ' Valid interface types: [admin, public, internal].' + ' (Env: OS_INTERFACE)'), + ) parser.add_argument( '--timing', default=False, action='store_true', - help="Print API call timing info", + help=_("Print API call timing info"), ) parser.add_argument( '--os-beta-command', action='store_true', - help="Enable beta commands which are subject to change", + help=_("Enable beta commands which are subject to change"), ) # osprofiler HMAC key argument @@ -262,7 +267,7 @@ class OpenStackShell(app.App): '--os-profile', metavar='hmac-key', dest='profile', - help='HMAC key for encrypting profiling context data', + help=_('HMAC key for encrypting profiling context data'), ) # NOTE(dtroyer): This global option should have been named # --os-profile as --profile interferes with at |
