summaryrefslogtreecommitdiff
path: root/openstackclient
diff options
context:
space:
mode:
authorHuanxuan Ao <huanxuan.ao@easystack.cn>2016-06-03 10:23:58 +0800
committerHuanxuan Ao <huanxuan.ao@easystack.cn>2016-06-03 12:15:22 +0800
commit95d5d9f76164628a6914f69255fdcd7a23179f38 (patch)
treef64b54c510809f74501254589ba585e3d01173ea /openstackclient
parent9f65a9954c0563038f3223700bc9f8205addbc79 (diff)
downloadpython-openstackclient-95d5d9f76164628a6914f69255fdcd7a23179f38.tar.gz
Fix some missing i18n support problems in compute
Found and Fix some missing i18n support problems in compute/client.py Change-Id: I54374f4eddafd9f80b6ccdaf8f8c30e098df105e Partial-bug: #1574965
Diffstat (limited to 'openstackclient')
-rw-r--r--openstackclient/compute/client.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/openstackclient/compute/client.py b/openstackclient/compute/client.py
index 82f09cec..8e6eedcf 100644
--- a/openstackclient/compute/client.py
+++ b/openstackclient/compute/client.py
@@ -17,6 +17,7 @@ import logging
from openstackclient.common import exceptions
from openstackclient.common import utils
+from openstackclient.i18n import _
LOG = logging.getLogger(__name__)
@@ -82,9 +83,9 @@ def build_option_parser(parser):
'--os-compute-api-version',
metavar='<compute-api-version>',
default=utils.env('OS_COMPUTE_API_VERSION'),
- help='Compute API version, default=' +
- DEFAULT_API_VERSION +
- ' (Env: OS_COMPUTE_API_VERSION)')
+ help=_("Compute API version, default=%s "
+ "(Env: OS_COMPUTE_API_VERSION)") % DEFAULT_API_VERSION
+ )
return parser
@@ -118,10 +119,9 @@ def check_api_version(check_version):
novaclient.API_MIN_VERSION,
novaclient.API_MAX_VERSION,
):
- raise exceptions.CommandError(
- "versions supported by client: %s - %s" % (
- novaclient.API_MIN_VERSION.get_string(),
- novaclient.API_MAX_VERSION.get_string(),
- ),
- )
+ msg = _("versions supported by client: %(min)s - %(max)s") % {
+ "min": novaclient.API_MIN_VERSION.get_string(),
+ "max": novaclient.API_MAX_VERSION.get_string(),
+ }
+ raise exceptions.CommandError(msg)
return True