Skip to content

Commit 9c7a5d4

Browse files
committed
pre-commit: Bump versions
Apply manual changes required by ruff. Automatic changes were done separately. Change-Id: I7db65bd2ac3f31b0479699946398752d8d729338 Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
1 parent ab2e68f commit 9c7a5d4

File tree

7 files changed

+13
-23
lines changed

7 files changed

+13
-23
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
repos:
33
- repo: https://github.com/pre-commit/pre-commit-hooks
4-
rev: v4.6.0
4+
rev: v5.0.0
55
hooks:
66
- id: trailing-whitespace
77
- id: mixed-line-ending
@@ -15,7 +15,7 @@ repos:
1515
files: .*\.(yaml|yml)$
1616
args: ['--unsafe']
1717
- repo: https://github.com/astral-sh/ruff-pre-commit
18-
rev: v0.6.2
18+
rev: v0.11.2
1919
hooks:
2020
- id: ruff
2121
args: ['--fix', '--unsafe-fixes']

examples/object_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def run(opts):
9494
c_list = obj_api.container_list()
9595
print("Name\tCount\tBytes")
9696
for c in c_list:
97-
print("%s\t%d\t%d" % (c['name'], c['count'], c['bytes']))
97+
print(f"{c['name']}\t{c['count']}\t{c['bytes']}")
9898

9999
if len(c_list) > 0:
100100
# See what is in the first container

examples/osc-lib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def run(opts):
8787
c_list = client_manager.object_store.container_list()
8888
print("Name\tCount\tBytes")
8989
for c in c_list:
90-
print("%s\t%d\t%d" % (c['name'], c['count'], c['bytes']))
90+
print(f"{c['name']}\t{c['count']}\t{c['bytes']}")
9191

9292
if len(c_list) > 0:
9393
# See what is in the first container

openstackclient/network/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def transform_compute_security_group_rule(sg_rule):
2323
from_port = info.pop('from_port')
2424
to_port = info.pop('to_port')
2525
if isinstance(from_port, int) and isinstance(to_port, int):
26-
port_range = {'port_range': "%u:%u" % (from_port, to_port)}
26+
port_range = {'port_range': f"{from_port}:{to_port}"}
2727
elif from_port is None and to_port is None:
2828
port_range = {'port_range': ""}
2929
else:

openstackclient/network/v2/router.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,8 +1270,7 @@ def get_parser(self, prog_name):
12701270
parser.add_argument(
12711271
metavar="<network>",
12721272
help=_(
1273-
"External Network to a attach a router gateway to (name or "
1274-
"ID)"
1273+
"External Network to a attach a router gateway to (name or ID)"
12751274
),
12761275
dest='external_gateways',
12771276
# The argument is stored in a list in order to reuse the
@@ -1338,8 +1337,7 @@ def get_parser(self, prog_name):
13381337
parser.add_argument(
13391338
metavar="<network>",
13401339
help=_(
1341-
"External Network to remove a router gateway from (name or "
1342-
"ID)"
1340+
"External Network to remove a router gateway from (name or ID)"
13431341
),
13441342
dest='external_gateways',
13451343
# The argument is stored in a list in order to reuse the

openstackclient/tests/functional/identity/v3/test_idp.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,9 @@ def test_idp_set(self):
5454
identity_provider = self._create_dummy_idp(add_clean_up=True)
5555
new_remoteid = data_utils.rand_name('newRemoteId')
5656
raw_output = self.openstack(
57-
'identity provider set '
58-
'%(identity-provider)s '
59-
'--remote-id %(remote-id)s '
60-
% {
61-
'identity-provider': identity_provider,
62-
'remote-id': new_remoteid,
63-
}
57+
f'identity provider set '
58+
f'{identity_provider} '
59+
f'--remote-id {new_remoteid}'
6460
)
6561
self.assertEqual(0, len(raw_output))
6662
raw_output = self.openstack(

openstackclient/tests/functional/identity/v3/test_service_provider.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,9 @@ def test_sp_set(self):
5252
service_provider = self._create_dummy_sp(add_clean_up=True)
5353
new_description = data_utils.rand_name('newDescription')
5454
raw_output = self.openstack(
55-
'service provider set '
56-
'%(service-provider)s '
57-
'--description %(description)s '
58-
% {
59-
'service-provider': service_provider,
60-
'description': new_description,
61-
}
55+
f'service provider set '
56+
f'{service_provider} '
57+
f'--description {new_description}'
6258
)
6359
updated_value = self.parse_show_as_object(raw_output)
6460
self.assertEqual(new_description, updated_value.get('description'))

0 commit comments

Comments
 (0)