2323from osc_lib import exceptions
2424from osc_lib import utils
2525
26+ from openstackclient .i18n import _
27+
2628
2729def find_service (identity_client , name_type_or_id ):
2830 """Find a service by id, name or type."""
@@ -37,14 +39,12 @@ def find_service(identity_client, name_type_or_id):
3739 # FIXME(dtroyer): This exception should eventually come from
3840 # common client exceptions
3941 except identity_exc .NotFound :
40- msg = ("No service with a type, name or ID of '%s' exists."
41- % name_type_or_id )
42- raise exceptions .CommandError (msg )
42+ msg = _ ("No service with a type, name or ID of '%s' exists." )
43+ raise exceptions .CommandError (msg % name_type_or_id )
4344 except identity_exc .NoUniqueMatch :
44- msg = ("Multiple service matches found for '%s', "
45- "use an ID to be more specific."
46- % name_type_or_id )
47- raise exceptions .CommandError (msg )
45+ msg = _ ("Multiple service matches found for '%s', "
46+ "use an ID to be more specific." )
47+ raise exceptions .CommandError (msg % name_type_or_id )
4848
4949
5050def _get_domain_id_if_requested (identity_client , domain_name_or_id ):
@@ -131,29 +131,29 @@ def add_user_domain_option_to_parser(parser):
131131 parser .add_argument (
132132 '--user-domain' ,
133133 metavar = '<user-domain>' ,
134- help = ('Domain the user belongs to (name or ID). '
135- 'This can be used in case collisions between user names '
136- 'exist.' )
134+ help = _ ('Domain the user belongs to (name or ID). '
135+ 'This can be used in case collisions between user names '
136+ 'exist.' ),
137137 )
138138
139139
140140def add_group_domain_option_to_parser (parser ):
141141 parser .add_argument (
142142 '--group-domain' ,
143143 metavar = '<group-domain>' ,
144- help = ('Domain the group belongs to (name or ID). '
145- 'This can be used in case collisions between group names '
146- 'exist.' )
144+ help = _ ('Domain the group belongs to (name or ID). '
145+ 'This can be used in case collisions between group names '
146+ 'exist.' ),
147147 )
148148
149149
150150def add_project_domain_option_to_parser (parser ):
151151 parser .add_argument (
152152 '--project-domain' ,
153153 metavar = '<project-domain>' ,
154- help = ('Domain the project belongs to (name or ID). '
155- 'This can be used in case collisions between project names '
156- 'exist.' )
154+ help = _ ('Domain the project belongs to (name or ID). '
155+ 'This can be used in case collisions between project names '
156+ 'exist.' ),
157157 )
158158
159159
@@ -162,5 +162,6 @@ def add_inherited_option_to_parser(parser):
162162 '--inherited' ,
163163 action = 'store_true' ,
164164 default = False ,
165- help = ('Specifies if the role grant is inheritable to the sub projects' )
165+ help = _ ('Specifies if the role grant is inheritable to the sub '
166+ 'projects' ),
166167 )
0 commit comments