|
17 | 17 |
|
18 | 18 | from openstackclient.common import exceptions |
19 | 19 | from openstackclient.common import utils |
| 20 | +from openstackclient.i18n import _ |
20 | 21 |
|
21 | 22 | LOG = logging.getLogger(__name__) |
22 | 23 |
|
@@ -82,9 +83,9 @@ def build_option_parser(parser): |
82 | 83 | '--os-compute-api-version', |
83 | 84 | metavar='<compute-api-version>', |
84 | 85 | 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 | + ) |
88 | 89 | return parser |
89 | 90 |
|
90 | 91 |
|
@@ -118,10 +119,9 @@ def check_api_version(check_version): |
118 | 119 | novaclient.API_MIN_VERSION, |
119 | 120 | novaclient.API_MAX_VERSION, |
120 | 121 | ): |
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) |
127 | 127 | return True |
0 commit comments