File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717from openstack import profile
1818
1919from openstackclient .common import utils
20+ from openstackclient .i18n import _
2021
2122
2223LOG = logging .getLogger (__name__ )
@@ -51,7 +52,7 @@ def build_option_parser(parser):
5152 '--os-network-api-version' ,
5253 metavar = '<network-api-version>' ,
5354 default = utils .env ('OS_NETWORK_API_VERSION' ),
54- help = ' Network API version, default=' +
55- DEFAULT_API_VERSION +
56- ' (Env: OS_NETWORK_API_VERSION)' )
55+ help = _ ( " Network API version, default=%s "
56+ "(Env: OS_NETWORK_API_VERSION)" ) % DEFAULT_API_VERSION
57+ )
5758 return parser
Original file line number Diff line number Diff line change 1616
1717from openstackclient .common import command
1818from openstackclient .common import exceptions
19+ from openstackclient .i18n import _
1920
2021
2122@six .add_metaclass (abc .ABCMeta )
@@ -94,14 +95,22 @@ def take_action(self, parsed_args):
9495 self .take_action_compute (self .app .client_manager .compute ,
9596 parsed_args )
9697 except Exception as e :
97- self .app .log .error ("Failed to delete %s with name or ID "
98- "'%s': %s" % (self .resource , r , e ))
98+ msg = _ ("Failed to delete %(resource)s with name or ID "
99+ "'%(name_or_id)s': %(e)s" ) % {
100+ "resource" : self .resource ,
101+ "name_or_id" : r ,
102+ "e" : e ,
103+ }
104+ self .app .log .error (msg )
99105 ret += 1
100106
101107 if ret :
102108 total = len (resources )
103- msg = "%s of %s %ss failed to delete." % (ret , total ,
104- self .resource )
109+ msg = _ ("%(num)s of %(total)s %(resource)s failed to delete." ) % {
110+ "num" : ret ,
111+ "total" : total ,
112+ "resource" : self .resource ,
113+ }
105114 raise exceptions .CommandError (msg )
106115
107116
You can’t perform that action at this time.
0 commit comments