Skip to content

Commit 290bc58

Browse files
committed
Prepare for ruff bump
Change-Id: Ia9c402edebc8537d5019d18920b6679b05ea4378 Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
1 parent 702a37c commit 290bc58

File tree

120 files changed

+333
-490
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+333
-490
lines changed

openstackclient/compute/v2/agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def take_action(self, parsed_args):
114114

115115
if result > 0:
116116
total = len(parsed_args.id)
117-
msg = _("%(result)s of %(total)s agents failed " "to delete.") % {
117+
msg = _("%(result)s of %(total)s agents failed to delete.") % {
118118
'result': result,
119119
'total': total,
120120
}

openstackclient/compute/v2/aggregate.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,10 @@ def take_action(self, parsed_args):
168168

169169
if result > 0:
170170
total = len(parsed_args.aggregate)
171-
msg = _(
172-
"%(result)s of %(total)s aggregates failed " "to delete."
173-
) % {'result': result, 'total': total}
171+
msg = _("%(result)s of %(total)s aggregates failed to delete.") % {
172+
'result': result,
173+
'total': total,
174+
}
174175
raise exceptions.CommandError(msg)
175176

176177

openstackclient/compute/v2/flavor.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,7 @@ def take_action(self, parsed_args):
190190
compute_client.flavor_add_tenant_access(flavor.id, project_id)
191191
except Exception as e:
192192
msg = _(
193-
"Failed to add project %(project)s access to "
194-
"flavor: %(e)s"
193+
"Failed to add project %(project)s access to flavor: %(e)s"
195194
)
196195
LOG.error(msg, {'project': parsed_args.project, 'e': e})
197196
if parsed_args.properties:
@@ -242,7 +241,7 @@ def take_action(self, parsed_args):
242241

243242
if result > 0:
244243
total = len(parsed_args.flavor)
245-
msg = _("%(result)s of %(total)s flavors failed " "to delete.") % {
244+
msg = _("%(result)s of %(total)s flavors failed to delete.") % {
246245
'result': result,
247246
'total': total,
248247
}
@@ -404,9 +403,7 @@ def get_parser(self, prog_name):
404403
parser.add_argument(
405404
'--project',
406405
metavar='<project>',
407-
help=_(
408-
'Set flavor access to project (name or ID) ' '(admin only)'
409-
),
406+
help=_('Set flavor access to project (name or ID) (admin only)'),
410407
)
411408
identity_common.add_project_domain_option_to_parser(parser)
412409
parser.add_argument(
@@ -483,7 +480,7 @@ def take_action(self, parsed_args):
483480

484481
if result > 0:
485482
raise exceptions.CommandError(
486-
_("Command Failed: One or more of" " the operations failed")
483+
_("Command Failed: One or more of the operations failed")
487484
)
488485

489486

@@ -560,8 +557,7 @@ def get_parser(self, prog_name):
560557
'--project',
561558
metavar='<project>',
562559
help=_(
563-
'Remove flavor access from project (name or ID) '
564-
'(admin only)'
560+
'Remove flavor access from project (name or ID) (admin only)'
565561
),
566562
)
567563
identity_common.add_project_domain_option_to_parser(parser)
@@ -612,5 +608,5 @@ def take_action(self, parsed_args):
612608

613609
if result > 0:
614610
raise exceptions.CommandError(
615-
_("Command Failed: One or more of" " the operations failed")
611+
_("Command Failed: One or more of the operations failed")
616612
)

openstackclient/compute/v2/keypair.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,13 +258,13 @@ def take_action(self, parsed_args):
258258
except Exception as e:
259259
result += 1
260260
LOG.error(
261-
_("Failed to delete key with name " "'%(name)s': %(e)s"),
261+
_("Failed to delete key with name '%(name)s': %(e)s"),
262262
{'name': n, 'e': e},
263263
)
264264

265265
if result > 0:
266266
total = len(parsed_args.name)
267-
msg = _("%(result)s of %(total)s keys failed " "to delete.") % {
267+
msg = _("%(result)s of %(total)s keys failed to delete.") % {
268268
'result': result,
269269
'total': total,
270270
}

openstackclient/compute/v2/server.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1617,8 +1617,7 @@ def _match_image(image_api, wanted_properties):
16171617
image = images[0]
16181618
else:
16191619
msg = _(
1620-
'No images match the property expected by '
1621-
'--image-property'
1620+
'No images match the property expected by --image-property'
16221621
)
16231622
raise exceptions.CommandError(msg)
16241623

@@ -1902,7 +1901,7 @@ def _match_image(image_api, wanted_properties):
19021901

19031902
# Default to empty list if nothing was specified and let nova
19041903
# decide the default behavior.
1905-
networks: ty.Union[str, ty.List[ty.Dict[str, str]], None] = []
1904+
networks: ty.Union[str, list[dict[str, str]], None] = []
19061905

19071906
if 'auto' in parsed_args.nics or 'none' in parsed_args.nics:
19081907
if len(parsed_args.nics) > 1:
@@ -2424,8 +2423,7 @@ def get_parser(self, prog_name):
24242423
parser.add_argument(
24252424
'--key-name',
24262425
help=_(
2427-
'Search by keypair name '
2428-
'(admin only before microversion 2.83)'
2426+
'Search by keypair name (admin only before microversion 2.83)'
24292427
),
24302428
)
24312429
config_drive_group = parser.add_mutually_exclusive_group()
@@ -4475,8 +4473,7 @@ def get_parser(self, prog_name):
44754473
password_group.add_argument(
44764474
'--password',
44774475
help=_(
4478-
'Set the server password. '
4479-
'This option requires cloud support.'
4476+
'Set the server password. This option requires cloud support.'
44804477
),
44814478
)
44824479
password_group.add_argument(

openstackclient/compute/v2/service.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def take_action(self, parsed_args):
7070
if result > 0:
7171
total = len(parsed_args.service)
7272
msg = _(
73-
"%(result)s of %(total)s compute services failed " "to delete."
73+
"%(result)s of %(total)s compute services failed to delete."
7474
) % {'result': result, 'total': total}
7575
raise exceptions.CommandError(msg)
7676

@@ -153,8 +153,7 @@ def get_parser(self, prog_name):
153153
"service",
154154
metavar="<service>",
155155
help=_(
156-
"Name of service (Binary name), for example "
157-
"``nova-compute``"
156+
"Name of service (Binary name), for example ``nova-compute``"
158157
),
159158
)
160159
enabled_group = parser.add_mutually_exclusive_group()
@@ -281,9 +280,7 @@ def take_action(self, parsed_args):
281280
force_down = False
282281
if force_down is not None:
283282
if not sdk_utils.supports_microversion(compute_client, '2.11'):
284-
msg = _(
285-
'--os-compute-api-version 2.11 or later is ' 'required'
286-
)
283+
msg = _('--os-compute-api-version 2.11 or later is required')
287284
raise exceptions.CommandError(msg)
288285
try:
289286
compute_client.update_service_forced_down(
@@ -299,7 +296,6 @@ def take_action(self, parsed_args):
299296

300297
if result > 0:
301298
msg = _(
302-
"Compute service %(service)s of host %(host)s failed to "
303-
"set."
299+
"Compute service %(service)s of host %(host)s failed to set."
304300
) % {"service": parsed_args.service, "host": parsed_args.host}
305301
raise exceptions.CommandError(msg)

openstackclient/compute/v2/usage.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,7 @@ def get_parser(self, prog_name):
115115
metavar="<start>",
116116
default=None,
117117
help=_(
118-
"Usage range start date, ex 2012-01-20"
119-
" (default: 4 weeks ago)"
118+
"Usage range start date, ex 2012-01-20 (default: 4 weeks ago)"
120119
),
121120
)
122121
parser.add_argument(
@@ -222,8 +221,7 @@ def get_parser(self, prog_name):
222221
metavar="<start>",
223222
default=None,
224223
help=_(
225-
"Usage range start date, ex 2012-01-20"
226-
" (default: 4 weeks ago)"
224+
"Usage range start date, ex 2012-01-20 (default: 4 weeks ago)"
227225
),
228226
)
229227
parser.add_argument(

openstackclient/identity/client.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ def build_option_parser(parser):
6464
metavar='<identity-api-version>',
6565
default=utils.env('OS_IDENTITY_API_VERSION'),
6666
help=_(
67-
'Identity API version, default=%s '
68-
'(Env: OS_IDENTITY_API_VERSION)'
67+
'Identity API version, default=%s (Env: OS_IDENTITY_API_VERSION)'
6968
)
7069
% DEFAULT_API_VERSION,
7170
)

openstackclient/identity/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ def add_inherited_option_to_parser(parser):
335335
action='store_true',
336336
default=False,
337337
help=_(
338-
'Specifies if the role grant is inheritable to the sub ' 'projects'
338+
'Specifies if the role grant is inheritable to the sub projects'
339339
),
340340
)
341341

openstackclient/identity/v2_0/ec2creds.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,10 @@ def take_action(self, parsed_args):
128128

129129
if result > 0:
130130
total = len(parsed_args.access_keys)
131-
msg = _(
132-
"%(result)s of %(total)s EC2 keys failed " "to delete."
133-
) % {'result': result, 'total': total}
131+
msg = _("%(result)s of %(total)s EC2 keys failed to delete.") % {
132+
'result': result,
133+
'total': total,
134+
}
134135
raise exceptions.CommandError(msg)
135136

136137

0 commit comments

Comments
 (0)