2020from openstackclient .common import command
2121from openstackclient .common import parseractions
2222from openstackclient .common import utils
23+ from openstackclient .i18n import _
2324
2425
2526class AssociateQos (command .Command ):
@@ -30,12 +31,12 @@ def get_parser(self, prog_name):
3031 parser .add_argument (
3132 'qos_spec' ,
3233 metavar = '<qos-spec>' ,
33- help = 'QoS specification to modify (name or ID)' ,
34+ help = _ ( 'QoS specification to modify (name or ID)' ) ,
3435 )
3536 parser .add_argument (
3637 'volume_type' ,
3738 metavar = '<volume-type>' ,
38- help = 'Volume type to associate the QoS (name or ID)' ,
39+ help = _ ( 'Volume type to associate the QoS (name or ID)' ) ,
3940 )
4041 return parser
4142
@@ -57,23 +58,24 @@ def get_parser(self, prog_name):
5758 parser .add_argument (
5859 'name' ,
5960 metavar = '<name>' ,
60- help = 'New QoS specification name' ,
61+ help = _ ( 'New QoS specification name' ) ,
6162 )
6263 consumer_choices = ['front-end' , 'back-end' , 'both' ]
6364 parser .add_argument (
6465 '--consumer' ,
6566 metavar = '<consumer>' ,
6667 choices = consumer_choices ,
6768 default = 'both' ,
68- help = 'Consumer of the QoS. Valid consumers: %s '
69- "(defaults to 'both')" % utils .format_list (consumer_choices )
69+ help = (_ ('Consumer of the QoS. Valid consumers: %s '
70+ "(defaults to 'both')" ) %
71+ utils .format_list (consumer_choices ))
7072 )
7173 parser .add_argument (
7274 '--property' ,
7375 metavar = '<key=value>' ,
7476 action = parseractions .KeyValueAction ,
75- help = 'Set a QoS specification property '
76- '(repeat option to set multiple properties)' ,
77+ help = _ ( 'Set a QoS specification property '
78+ '(repeat option to set multiple properties)' ) ,
7779 )
7880 return parser
7981
@@ -99,7 +101,7 @@ def get_parser(self, prog_name):
99101 'qos_specs' ,
100102 metavar = '<qos-spec>' ,
101103 nargs = "+" ,
102- help = 'QoS specification(s) to delete (name or ID)' ,
104+ help = _ ( 'QoS specification(s) to delete (name or ID)' ) ,
103105 )
104106 return parser
105107
@@ -118,19 +120,19 @@ def get_parser(self, prog_name):
118120 parser .add_argument (
119121 'qos_spec' ,
120122 metavar = '<qos-spec>' ,
121- help = 'QoS specification to modify (name or ID)' ,
123+ help = _ ( 'QoS specification to modify (name or ID)' ) ,
122124 )
123125 volume_type_group = parser .add_mutually_exclusive_group ()
124126 volume_type_group .add_argument (
125127 '--volume-type' ,
126128 metavar = '<volume-type>' ,
127- help = 'Volume type to disassociate the QoS from (name or ID)' ,
129+ help = _ ( 'Volume type to disassociate the QoS from (name or ID)' ) ,
128130 )
129131 volume_type_group .add_argument (
130132 '--all' ,
131133 action = 'store_true' ,
132134 default = False ,
133- help = 'Disassociate the QoS from every volume type' ,
135+ help = _ ( 'Disassociate the QoS from every volume type' ) ,
134136 )
135137
136138 return parser
@@ -181,14 +183,14 @@ def get_parser(self, prog_name):
181183 parser .add_argument (
182184 'qos_spec' ,
183185 metavar = '<qos-spec>' ,
184- help = 'QoS specification to modify (name or ID)' ,
186+ help = _ ( 'QoS specification to modify (name or ID)' ) ,
185187 )
186188 parser .add_argument (
187189 '--property' ,
188190 metavar = '<key=value>' ,
189191 action = parseractions .KeyValueAction ,
190- help = 'Property to add or modify for this QoS specification '
191- '(repeat option to set multiple properties)' ,
192+ help = _ ( 'Property to add or modify for this QoS specification '
193+ '(repeat option to set multiple properties)' ) ,
192194 )
193195 return parser
194196
@@ -201,7 +203,7 @@ def take_action(self, parsed_args):
201203 volume_client .qos_specs .set_keys (qos_spec .id ,
202204 parsed_args .property )
203205 else :
204- self .app .log .error ("No changes requested\n " )
206+ self .app .log .error (_ ( "No changes requested\n " ) )
205207
206208
207209class ShowQos (command .ShowOne ):
@@ -212,7 +214,7 @@ def get_parser(self, prog_name):
212214 parser .add_argument (
213215 'qos_spec' ,
214216 metavar = '<qos-spec>' ,
215- help = 'QoS specification to display (name or ID)' ,
217+ help = _ ( 'QoS specification to display (name or ID)' ) ,
216218 )
217219 return parser
218220
@@ -241,15 +243,15 @@ def get_parser(self, prog_name):
241243 parser .add_argument (
242244 'qos_spec' ,
243245 metavar = '<qos-spec>' ,
244- help = 'QoS specification to modify (name or ID)' ,
246+ help = _ ( 'QoS specification to modify (name or ID)' ) ,
245247 )
246248 parser .add_argument (
247249 '--property' ,
248250 metavar = '<key>' ,
249251 action = 'append' ,
250252 default = [],
251- help = 'Property to remove from the QoS specification. '
252- '(repeat option to unset multiple properties)' ,
253+ help = _ ( 'Property to remove from the QoS specification. '
254+ '(repeat option to unset multiple properties)' ) ,
253255 )
254256 return parser
255257
@@ -262,4 +264,4 @@ def take_action(self, parsed_args):
262264 volume_client .qos_specs .unset_keys (qos_spec .id ,
263265 parsed_args .property )
264266 else :
265- self .app .log .error ("No changes requested\n " )
267+ self .app .log .error (_ ( "No changes requested\n " ) )
0 commit comments