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>
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v4.6.0
|
rev: v5.0.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
- id: mixed-line-ending
|
- id: mixed-line-ending
|
||||||
@@ -15,7 +15,7 @@ repos:
|
|||||||
files: .*\.(yaml|yml)$
|
files: .*\.(yaml|yml)$
|
||||||
args: ['--unsafe']
|
args: ['--unsafe']
|
||||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||||
rev: v0.6.2
|
rev: v0.11.2
|
||||||
hooks:
|
hooks:
|
||||||
- id: ruff
|
- id: ruff
|
||||||
args: ['--fix', '--unsafe-fixes']
|
args: ['--fix', '--unsafe-fixes']
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ def run(opts):
|
|||||||
c_list = obj_api.container_list()
|
c_list = obj_api.container_list()
|
||||||
print("Name\tCount\tBytes")
|
print("Name\tCount\tBytes")
|
||||||
for c in c_list:
|
for c in c_list:
|
||||||
print("%s\t%d\t%d" % (c['name'], c['count'], c['bytes']))
|
print(f"{c['name']}\t{c['count']}\t{c['bytes']}")
|
||||||
|
|
||||||
if len(c_list) > 0:
|
if len(c_list) > 0:
|
||||||
# See what is in the first container
|
# See what is in the first container
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ def run(opts):
|
|||||||
c_list = client_manager.object_store.container_list()
|
c_list = client_manager.object_store.container_list()
|
||||||
print("Name\tCount\tBytes")
|
print("Name\tCount\tBytes")
|
||||||
for c in c_list:
|
for c in c_list:
|
||||||
print("%s\t%d\t%d" % (c['name'], c['count'], c['bytes']))
|
print(f"{c['name']}\t{c['count']}\t{c['bytes']}")
|
||||||
|
|
||||||
if len(c_list) > 0:
|
if len(c_list) > 0:
|
||||||
# See what is in the first container
|
# See what is in the first container
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ def transform_compute_security_group_rule(sg_rule):
|
|||||||
from_port = info.pop('from_port')
|
from_port = info.pop('from_port')
|
||||||
to_port = info.pop('to_port')
|
to_port = info.pop('to_port')
|
||||||
if isinstance(from_port, int) and isinstance(to_port, int):
|
if isinstance(from_port, int) and isinstance(to_port, int):
|
||||||
port_range = {'port_range': "%u:%u" % (from_port, to_port)}
|
port_range = {'port_range': f"{from_port}:{to_port}"}
|
||||||
elif from_port is None and to_port is None:
|
elif from_port is None and to_port is None:
|
||||||
port_range = {'port_range': ""}
|
port_range = {'port_range': ""}
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -1270,8 +1270,7 @@ class AddGatewayToRouter(command.ShowOne):
|
|||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
metavar="<network>",
|
metavar="<network>",
|
||||||
help=_(
|
help=_(
|
||||||
"External Network to a attach a router gateway to (name or "
|
"External Network to a attach a router gateway to (name or ID)"
|
||||||
"ID)"
|
|
||||||
),
|
),
|
||||||
dest='external_gateways',
|
dest='external_gateways',
|
||||||
# The argument is stored in a list in order to reuse the
|
# The argument is stored in a list in order to reuse the
|
||||||
@@ -1338,8 +1337,7 @@ class RemoveGatewayFromRouter(command.ShowOne):
|
|||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
metavar="<network>",
|
metavar="<network>",
|
||||||
help=_(
|
help=_(
|
||||||
"External Network to remove a router gateway from (name or "
|
"External Network to remove a router gateway from (name or ID)"
|
||||||
"ID)"
|
|
||||||
),
|
),
|
||||||
dest='external_gateways',
|
dest='external_gateways',
|
||||||
# The argument is stored in a list in order to reuse the
|
# The argument is stored in a list in order to reuse the
|
||||||
|
|||||||
@@ -54,13 +54,9 @@ class IdentityProviderTests(common.IdentityTests):
|
|||||||
identity_provider = self._create_dummy_idp(add_clean_up=True)
|
identity_provider = self._create_dummy_idp(add_clean_up=True)
|
||||||
new_remoteid = data_utils.rand_name('newRemoteId')
|
new_remoteid = data_utils.rand_name('newRemoteId')
|
||||||
raw_output = self.openstack(
|
raw_output = self.openstack(
|
||||||
'identity provider set '
|
f'identity provider set '
|
||||||
'%(identity-provider)s '
|
f'{identity_provider} '
|
||||||
'--remote-id %(remote-id)s '
|
f'--remote-id {new_remoteid}'
|
||||||
% {
|
|
||||||
'identity-provider': identity_provider,
|
|
||||||
'remote-id': new_remoteid,
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
self.assertEqual(0, len(raw_output))
|
self.assertEqual(0, len(raw_output))
|
||||||
raw_output = self.openstack(
|
raw_output = self.openstack(
|
||||||
|
|||||||
@@ -52,13 +52,9 @@ class ServiceProviderTests(common.IdentityTests):
|
|||||||
service_provider = self._create_dummy_sp(add_clean_up=True)
|
service_provider = self._create_dummy_sp(add_clean_up=True)
|
||||||
new_description = data_utils.rand_name('newDescription')
|
new_description = data_utils.rand_name('newDescription')
|
||||||
raw_output = self.openstack(
|
raw_output = self.openstack(
|
||||||
'service provider set '
|
f'service provider set '
|
||||||
'%(service-provider)s '
|
f'{service_provider} '
|
||||||
'--description %(description)s '
|
f'--description {new_description}'
|
||||||
% {
|
|
||||||
'service-provider': service_provider,
|
|
||||||
'description': new_description,
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
updated_value = self.parse_show_as_object(raw_output)
|
updated_value = self.parse_show_as_object(raw_output)
|
||||||
self.assertEqual(new_description, updated_value.get('description'))
|
self.assertEqual(new_description, updated_value.get('description'))
|
||||||
|
|||||||
Reference in New Issue
Block a user