Skip to content

Commit 95d5d9f

Browse files
author
Huanxuan Ao
committed
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
1 parent 9f65a99 commit 95d5d9f

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

openstackclient/compute/client.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
from openstackclient.common import exceptions
1919
from openstackclient.common import utils
20+
from openstackclient.i18n import _
2021

2122
LOG = logging.getLogger(__name__)
2223

@@ -82,9 +83,9 @@ def build_option_parser(parser):
8283
'--os-compute-api-version',
8384
metavar='<compute-api-version>',
8485
default=utils.env('OS_COMPUTE_API_VERSION'),
85-
help='Compute API version, default=' +
86-
DEFAULT_API_VERSION +
87-
' (Env: OS_COMPUTE_API_VERSION)')
86+
help=_("Compute API version, default=%s "
87+
"(Env: OS_COMPUTE_API_VERSION)") % DEFAULT_API_VERSION
88+
)
8889
return parser
8990

9091

@@ -118,10 +119,9 @@ def check_api_version(check_version):
118119
novaclient.API_MIN_VERSION,
119120
novaclient.API_MAX_VERSION,
120121
):
121-
raise exceptions.CommandError(
122-
"versions supported by client: %s - %s" % (
123-
novaclient.API_MIN_VERSION.get_string(),
124-
novaclient.API_MAX_VERSION.get_string(),
125-
),
126-
)
122+
msg = _("versions supported by client: %(min)s - %(max)s") % {
123+
"min": novaclient.API_MIN_VERSION.get_string(),
124+
"max": novaclient.API_MAX_VERSION.get_string(),
125+
}
126+
raise exceptions.CommandError(msg)
127127
return True

0 commit comments

Comments
 (0)