Re-enable E501 errors

Change-Id: Id6ca5075bd11765f00b62b44f91635ef68205175
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This commit is contained in:
Stephen Finucane
2025-10-31 13:37:41 +00:00
parent 16aaa8e743
commit 3e3b385c8c
28 changed files with 190 additions and 113 deletions

View File

@@ -177,7 +177,10 @@ class VersionedMethod:
self.func = func
def __str__(self):
return f"Version Method {self.name}: min: {self.start_version}, max: {self.end_version}"
return (
f"Version Method {self.name}: min: {self.start_version}, "
f"max: {self.end_version}"
)
def __repr__(self):
return f"<VersionedMethod {self.name}>"
@@ -323,8 +326,8 @@ def _validate_requested_version(
else:
raise exceptions.UnsupportedVersion(
_(
"The specified version isn't supported by server. The valid "
"version range is '%(min)s' to '%(max)s'"
"The specified version isn't supported by server. "
"The valid version range is '%(min)s' to '%(max)s'"
)
% {
"min": server_start_version.get_string(),
@@ -349,7 +352,8 @@ def _validate_server_version(server_start_version, server_end_version):
if manilaclient.API_MIN_VERSION > server_end_version:
raise exceptions.UnsupportedVersion(
_(
"Server's version is too old. The client's valid version range "
"Server's version is too old. "
"The client's valid version range "
"is '%(client_min)s' to '%(client_max)s'. The server valid "
"version range is '%(server_min)s' to '%(server_max)s'."
)
@@ -363,7 +367,8 @@ def _validate_server_version(server_start_version, server_end_version):
elif manilaclient.API_MAX_VERSION < server_start_version:
raise exceptions.UnsupportedVersion(
_(
"Server's version is too new. The client's valid version range "
"Server's version is too new. "
"The client's valid version range "
"is '%(client_min)s' to '%(client_max)s'. The server valid "
"version range is '%(server_min)s' to '%(server_max)s'."
)

View File

@@ -96,7 +96,8 @@ RESOURCE_LOCK_SORT_KEY_VALUES = (
'updated_at',
'resource_id',
'resource_type',
'resource_actionlock_reason',
'resource_action',
'lock_reason',
)
BACKUP_SORT_KEY_VALUES = (

View File

@@ -148,8 +148,8 @@ class QuotaSet(command.Command):
type=int,
default=None,
help=_(
"New value for the 'per-share-gigabytes' quota."
"Available only for microversion >= 2.62"
'New value for the "per-share-gigabytes" quota. '
'Available only for microversion >= 2.62'
),
)
parser.add_argument(
@@ -158,8 +158,8 @@ class QuotaSet(command.Command):
type=int,
default=None,
help=_(
"New value for the 'encryption-keys' quota."
"Available only for microversion >= 2.90"
'New value for the "encryption-keys" quota. '
'Available only for microversion >= 2.90'
),
)
parser.add_argument(
@@ -202,8 +202,8 @@ class QuotaSet(command.Command):
if share_client.api_version < api_versions.APIVersion('2.40'):
raise exceptions.CommandError(
_(
"'share group' quotas are available only starting with "
"'2.40' API microversion."
"'share group' quotas are available only "
"starting with '2.40' API microversion."
)
)
kwargs["share_groups"] = parsed_args.share_groups
@@ -220,8 +220,8 @@ class QuotaSet(command.Command):
if share_client.api_version < api_versions.APIVersion('2.53'):
raise exceptions.CommandError(
_(
"setting the number of 'share replicas' is available only "
"starting with API microversion '2.53'."
"setting the number of 'share replicas' is available "
"only starting with API microversion '2.53'."
)
)
kwargs["share_replicas"] = parsed_args.share_replicas
@@ -230,7 +230,8 @@ class QuotaSet(command.Command):
raise exceptions.CommandError(
_(
"setting the capacity of share replicas in total "
"is available only starting with API microversion '2.53'."
"is available only starting with API microversion "
"'2.53'."
)
)
kwargs["replica_gigabytes"] = parsed_args.replica_gigabytes
@@ -257,12 +258,12 @@ class QuotaSet(command.Command):
raise exceptions.CommandError(
_(
"Nothing to set. "
"New quota must be specified to at least one of the following "
"resources: 'shares', 'snapshots', 'gigabytes', "
"New quota must be specified to at least one of the "
"following resources: 'shares', 'snapshots', 'gigabytes', "
"'snapshot-gigabytes', 'share-networks', 'share-type', "
"'share-groups', 'share-group-snapshots', 'share-replicas', "
"'replica-gigabytes', 'per-share-gigabytes', "
"'encryption_keys'"
"'share-groups', 'share-group-snapshots', "
"'share-replicas', 'replica-gigabytes', "
"'per-share-gigabytes', 'encryption_keys'"
)
)
@@ -383,8 +384,8 @@ class QuotaShow(command.ShowOne):
if share_client.api_version < api_versions.APIVersion("2.39"):
raise exceptions.CommandError(
_(
"'share type' quotas are available only starting with "
"'2.39' API microversion."
"'share type' quotas are available only "
"starting with '2.39' API microversion."
)
)
kwargs["share_type"] = parsed_args.share_type

View File

@@ -252,8 +252,10 @@ class ListResourceLock(command.Lister):
type=str,
default=None,
choices=constants.RESOURCE_LOCK_SORT_KEY_VALUES,
help=f'Key to be sorted, available keys are {constants.RESOURCE_LOCK_SORT_KEY_VALUES}. '
'Default=None.',
help=(
f'Key to be sorted, available keys are '
f'{constants.RESOURCE_LOCK_SORT_KEY_VALUES}. Default=None.'
),
)
parser.add_argument(
'--sort-dir',
@@ -262,8 +264,10 @@ class ListResourceLock(command.Lister):
type=str,
default=None,
choices=constants.SORT_DIR_VALUES,
help=f'Sort direction, available values are {constants.SORT_DIR_VALUES}. '
'OPTIONAL: Default=None.',
help=(
f'Sort direction, available values are '
f'{constants.SORT_DIR_VALUES}. OPTIONAL: Default=None.'
),
)
parser.add_argument(
'--detailed',

View File

@@ -616,8 +616,8 @@ class ListShareSecurityService(command.Lister):
elif parsed_args.ou:
raise exceptions.CommandError(
_(
"Filtering results by security service Organizational Unit is "
"available only for microversion >= 2.44"
"Filtering results by security service Organizational "
"Unit is available only for microversion >= 2.44"
)
)

View File

@@ -195,7 +195,7 @@ class CreateShare(command.ShowOne):
action=parseractions.KeyValueAction,
help=_(
"Set Scheduler hints for the share as key=value pairs, "
"possible keys are same_host, different_host."
"possible keys are same_host, different_host. "
"(repeat option to set multiple hints)"
),
)
@@ -1595,7 +1595,7 @@ class ShareMigrationStart(command.Command):
choices=['True', 'False'],
help=_(
"Enforces migration to preserve all file metadata when "
"moving its contents. If set to True, host-assisted"
"moving its contents. If set to True, host-assisted "
"migration will not be attempted."
),
)
@@ -1606,7 +1606,7 @@ class ShareMigrationStart(command.Command):
choices=['True', 'False'],
help=_(
"Enforces migration of the share snapshots to the "
"destination. If set to True, host-assisted migration"
"destination. If set to True, host-assisted migration "
"will not be attempted."
),
)
@@ -1617,7 +1617,7 @@ class ShareMigrationStart(command.Command):
choices=['True', 'False'],
help=_(
"Enforces migration to keep the share writable while "
"contents are being moved. If set to True, host-assisted"
"contents are being moved. If set to True, host-assisted "
"migration will not be attempted."
),
)
@@ -1637,7 +1637,7 @@ class ShareMigrationStart(command.Command):
default=None,
help=_(
"Specify the new share network for the share. Do not "
"specify this parameter if the migrating share has to be"
"specify this parameter if the migrating share has to be "
"retained within its current share network."
),
)

View File

@@ -205,8 +205,10 @@ class ListShareBackup(command.Lister):
metavar='<sort_key>',
type=str,
default=None,
help=f'Key to be sorted, available keys are {constants.BACKUP_SORT_KEY_VALUES}. '
'Default=None.',
help=(
f'Key to be sorted, available keys are '
f'{constants.BACKUP_SORT_KEY_VALUES}. Default=None.'
),
)
parser.add_argument(
'--sort-dir',
@@ -214,8 +216,10 @@ class ListShareBackup(command.Lister):
metavar='<sort_dir>',
type=str,
default=None,
help=f'Sort direction, available values are {constants.SORT_DIR_VALUES}. '
'OPTIONAL: Default=None.',
help=(
f'Sort direction, available values are '
f'{constants.SORT_DIR_VALUES}. OPTIONAL: Default=None.'
),
)
parser.add_argument(
'--detail',

View File

@@ -677,7 +677,7 @@ class SetShareNetwork(command.Command):
if new_security_service and current_security_service:
try:
if parsed_args.check_only:
check_result = share_client.share_networks.update_share_network_security_service_check(
check_result = share_client.share_networks.update_share_network_security_service_check( # noqa: E501
share_network,
current_security_service,
new_security_service,

View File

@@ -83,8 +83,8 @@ class ListSharePools(command.Lister):
else:
raise exceptions.CommandError(
_(
"Filtering results by share type is only available with "
"manila API version >= 2.23"
"Filtering results by share type is only "
"available with manila API version >= 2.23"
)
)

View File

@@ -81,8 +81,8 @@ class CreateShareReplica(command.ShowOne):
if share_client.api_version < api_versions.APIVersion("2.67"):
raise exceptions.CommandError(
_(
"arg '--scheduler_hint' is available only starting with "
"API microversion '2.67'."
"arg '--scheduler_hint' is available only starting "
"with API microversion '2.67'."
)
)

View File

@@ -587,7 +587,7 @@ class ShareServerMigrationCancel(command.Command):
class ShareServerMigrationComplete(command.Command):
"""Completes migration for a given share server (Admin only, Experimental)."""
"""Completes migration for a share server (Admin only, Experimental)."""
_description = _("Completes migration for a given share server")

View File

@@ -178,8 +178,11 @@ class ListShareTransfer(command.Lister):
metavar='<sort_key>',
type=str,
default=None,
help=f'Key to be sorted, available keys are {constants.SHARE_TRANSFER_SORT_KEY_VALUES}. '
'Default=None.',
help=(
f'Key to be sorted, available keys are '
f'{constants.SHARE_TRANSFER_SORT_KEY_VALUES}. '
f'Default=None.'
),
)
parser.add_argument(
'--sort-dir',
@@ -187,8 +190,11 @@ class ListShareTransfer(command.Lister):
metavar='<sort_dir>',
type=str,
default=None,
help=f'Sort direction, available values are {constants.SORT_DIR_VALUES}. '
'OPTIONAL: Default=None.',
help=(
f'Sort direction, available values are '
f'{constants.SORT_DIR_VALUES}. '
f'OPTIONAL: Default=None.'
),
)
parser.add_argument(
'--detailed',

View File

@@ -95,8 +95,9 @@ class ManilaClientArgumentParser(argparse.ArgumentParser):
progparts = self.prog.partition(' ')
self.exit(
2,
f"error: {message.split(choose_from)[0]}\nTry '{progparts[0]} help {progparts[2]}'"
" for more information.\n",
f"error: {message.split(choose_from)[0]}\n"
f"Try '{progparts[0]} help {progparts[2]}' "
f"for more information.\n",
)
def _get_option_tuples(self, option_string):

View File

@@ -394,7 +394,10 @@ class ManilaCLIClient(base.CLIClient):
if identity_api_version == "3":
if CONF.admin_project_domain_name:
flags += f"--os-project-domain-name {CONF.admin_project_domain_name} "
flags += (
f"--os-project-domain-name "
f"{CONF.admin_project_domain_name} "
)
elif CONF.admin_project_domain_id:
flags += (
f"--os-project-domain-id {CONF.admin_project_domain_id} "
@@ -840,7 +843,8 @@ class ManilaCLIClient(base.CLIClient):
):
"""Delete a share_network."""
self.manila(
f'share-network-subnet-delete {share_network} {share_network_subnet}',
f'share-network-subnet-delete {share_network} '
f'{share_network_subnet}',
microversion=microversion,
)
@@ -1513,7 +1517,8 @@ class ManilaCLIClient(base.CLIClient):
if int(time.time()) - start >= self.build_timeout:
message = (
f"Snapshot {snapshot_name} failed to reach {status} "
f"status within the required time ({self.build_timeout} s)."
f"status within the required time "
f"({self.build_timeout} s)."
)
raise tempest_lib_exc.TimeoutException(message)
@@ -1619,8 +1624,8 @@ class ManilaCLIClient(base.CLIClient):
microversion=None,
):
cmd = (
f'access-allow --access-level {access_level} {share_id} {access_type} '
f'{access_to}'
f'access-allow --access-level {access_level} {share_id} '
f'{access_type} {access_to}'
)
if metadata:
metadata_cli = ''
@@ -1739,7 +1744,10 @@ class ManilaCLIClient(base.CLIClient):
f'--preserve-snapshots {preserve_snapshots}'
)
if force_host_assisted_migration:
cmd += f' --force-host-assisted-migration {force_host_assisted_migration}'
cmd += (
f' --force-host-assisted-migration '
f'{force_host_assisted_migration}'
)
if new_share_network:
cmd += f' --new-share-network {new_share_network}'
if new_share_type:
@@ -1918,7 +1926,8 @@ class ManilaCLIClient(base.CLIClient):
:param microversion: API microversion to be used for request.
"""
snapshot_raw = self.manila(
f'snapshot-instance-export-location-show {snapshot} {export_location_uuid}',
f'snapshot-instance-export-location-show {snapshot} '
f'{export_location_uuid}',
microversion=microversion,
)
snapshot = output_parser.details(snapshot_raw)
@@ -2056,7 +2065,10 @@ class ManilaCLIClient(base.CLIClient):
self, host, share_network, identifier, driver_options=None
):
if driver_options:
command = f'share-server-manage {host} {share_network} {identifier} {driver_options}'
command = (
f'share-server-manage {host} {share_network} {identifier} '
f'{driver_options}'
)
else:
command = (
f'share-server-manage {host} {share_network} {identifier}'
@@ -2067,7 +2079,8 @@ class ManilaCLIClient(base.CLIClient):
def manage_share(self, host, protocol, export_location, share_server):
managed_share_raw = self.manila(
f'manage {host} {protocol} {export_location} --share-server-id {share_server}'
f'manage {host} {protocol} {export_location} '
f'--share-server-id {share_server}'
)
managed_share = output_parser.details(managed_share_raw)
return managed_share['id']
@@ -2175,8 +2188,8 @@ class ManilaCLIClient(base.CLIClient):
if int(time.time()) - start >= self.build_timeout:
message = (
f'No message for resource with id {resource_id} was created in'
f' the required time ({self.build_timeout} s).'
f'No message for resource with id {resource_id} was '
f'created in the required time ({self.build_timeout} s).'
)
raise tempest_lib_exc.TimeoutException(message)

View File

@@ -58,7 +58,10 @@ class QuotasReadWriteTest(base.BaseTestCase):
def _verify_current_st_quotas_equal_to(self, quotas, microversion):
# Read share type quotas
cmd = f'quota-show --tenant-id {self.project_id} --share-type {self.st_id}'
cmd = (
f'quota-show --tenant-id {self.project_id} '
f'--share-type {self.st_id}'
)
st_quotas_raw = self.admin_client.manila(
cmd, microversion=microversion
)
@@ -143,7 +146,10 @@ class QuotasReadWriteTest(base.BaseTestCase):
self._verify_current_quotas_equal_to(p_custom_quotas, microversion)
# Reset quotas
cmd = f'quota-delete --tenant-id {self.project_id} --share-type {self.st_id}'
cmd = (
f'quota-delete --tenant-id {self.project_id} '
f'--share-type {self.st_id}'
)
self.admin_client.manila(cmd, microversion=microversion)
# Verify quotas after reset
@@ -191,7 +197,10 @@ class QuotasReadWriteTest(base.BaseTestCase):
@ddt.data('--share-groups', '--share-group-snapshots')
@utils.skip_if_microversion_not_supported("2.40")
def test_update_share_type_quotas_for_share_groups(self, arg):
cmd = f'quota-update {self.project_id} --share-type {self.st_id} {arg} 13'
cmd = (
f'quota-update {self.project_id} --share-type {self.st_id} '
f'{arg} 13'
)
self.assertRaises(
exceptions.CommandFailed,
self.admin_client.manila,
@@ -268,7 +277,10 @@ class QuotasReadWriteTest(base.BaseTestCase):
self._verify_current_st_quotas_equal_to(st_custom_quotas, microversion)
# Reset share type quotas
cmd = f'quota-delete --tenant-id {self.project_id} --share-type {self.st_id}'
cmd = (
f'quota-delete --tenant-id {self.project_id} '
f'--share-type {self.st_id}'
)
self.admin_client.manila(cmd, microversion=microversion)
# Verify share type quotas after reset
@@ -276,7 +288,10 @@ class QuotasReadWriteTest(base.BaseTestCase):
@utils.skip_if_microversion_not_supported("2.38")
def test_read_share_type_quotas_with_too_old_microversion(self):
cmd = f'quota-show --tenant-id {self.project_id} --share-type {self.st_id}'
cmd = (
f'quota-show --tenant-id {self.project_id} '
f'--share-type {self.st_id}'
)
self.assertRaises(
exceptions.CommandFailed,
self.admin_client.manila,
@@ -298,7 +313,10 @@ class QuotasReadWriteTest(base.BaseTestCase):
@utils.skip_if_microversion_not_supported("2.38")
def test_delete_share_type_quotas_with_too_old_microversion(self):
cmd = f'quota-delete --tenant-id {self.project_id} --share-type {self.st_id}'
cmd = (
f'quota-delete --tenant-id {self.project_id} '
f'--share-type {self.st_id}'
)
self.assertRaises(
exceptions.CommandFailed,
self.admin_client.manila,

View File

@@ -67,7 +67,8 @@ class FakeClient:
break
assert found, (
f'Expected {expected[0]} {expected[1]}; got {self.client.callstack}'
f'Expected {expected[0]} {expected[1]}; '
f'got {self.client.callstack}'
)
if body is not None:

View File

@@ -26,7 +26,7 @@ class TestAvailabilityZones(manila_fakes.TestShare):
class TestShareAvailabilityZoneList(TestAvailabilityZones):
availability_zones = manila_fakes.FakeShareAvailabilityZones.create_share_availability_zones()
availability_zones = manila_fakes.FakeShareAvailabilityZones.create_share_availability_zones() # noqa: E501
COLUMNS = ("Id", "Name", "Created At", "Updated At")
def setUp(self):

View File

@@ -42,7 +42,7 @@ class TestShareSecurityServiceCreate(TestShareSecurityService):
def setUp(self):
super().setUp()
self.security_service = manila_fakes.FakeShareSecurityService.create_fake_security_service()
self.security_service = manila_fakes.FakeShareSecurityService.create_fake_security_service() # noqa: E501
self.security_services_mock.create.return_value = self.security_service
self.cmd = osc_security_services.CreateShareSecurityService(
self.app, None
@@ -154,10 +154,10 @@ class TestShareSecurityServiceDelete(TestShareSecurityService):
def setUp(self):
super().setUp()
self.security_service = manila_fakes.FakeShareSecurityService.create_fake_security_service()
self.security_service = manila_fakes.FakeShareSecurityService.create_fake_security_service() # noqa: E501
self.security_services_mock.get.return_value = self.security_service
self.security_services = manila_fakes.FakeShareSecurityService.create_fake_security_services()
self.security_services = manila_fakes.FakeShareSecurityService.create_fake_security_services() # noqa: E501
self.cmd = osc_security_services.DeleteShareSecurityService(
self.app, None
@@ -218,7 +218,7 @@ class TestShareSecurityServiceShow(TestShareSecurityService):
def setUp(self):
super().setUp()
self.security_service = manila_fakes.FakeShareSecurityService.create_fake_security_service()
self.security_service = manila_fakes.FakeShareSecurityService.create_fake_security_service() # noqa: E501
self.security_services_mock.get.return_value = self.security_service
self.cmd = osc_security_services.ShowShareSecurityService(
@@ -510,7 +510,7 @@ class TestShareSecurityServiceList(TestShareSecurityService):
manila_fakes.FakeShareNetwork.create_one_share_network()
)
self.share_networks_mock.get.return_value = self.share_network
self.services_list = manila_fakes.FakeShareSecurityService.create_fake_security_services()
self.services_list = manila_fakes.FakeShareSecurityService.create_fake_security_services() # noqa: E501
self.security_services_mock.list.return_value = self.services_list
self.values = (
oscutils.get_dict_properties(i._info, self.columns)

View File

@@ -53,7 +53,7 @@ class TestCreateShareGroupSnapshot(TestShareGroupSnapshot):
self.share_group = manila_fakes.FakeShareGroup.create_one_share_group()
self.groups_mock.get.return_value = self.share_group
self.share_group_snapshot = manila_fakes.FakeShareGroupSnapshot.create_one_share_group_snapshot()
self.share_group_snapshot = manila_fakes.FakeShareGroupSnapshot.create_one_share_group_snapshot() # noqa: E501
self.group_snapshot_mocks.create.return_value = (
self.share_group_snapshot
)
@@ -171,7 +171,7 @@ class TestDeleteShareGroupSnapshot(TestShareGroupSnapshot):
def setUp(self):
super().setUp()
self.share_group_snapshot = manila_fakes.FakeShareGroupSnapshot.create_one_share_group_snapshot()
self.share_group_snapshot = manila_fakes.FakeShareGroupSnapshot.create_one_share_group_snapshot() # noqa: E501
self.group_snapshot_mocks.get.return_value = self.share_group_snapshot
self.cmd = osc_share_group_snapshots.DeleteShareGroupSnapshot(
@@ -294,7 +294,7 @@ class TestShowShareGroupSnapshot(TestShareGroupSnapshot):
def setUp(self):
super().setUp()
self.share_group_snapshot = manila_fakes.FakeShareGroupSnapshot.create_one_share_group_snapshot()
self.share_group_snapshot = manila_fakes.FakeShareGroupSnapshot.create_one_share_group_snapshot() # noqa: E501
self.group_snapshot_mocks.get.return_value = self.share_group_snapshot
self.cmd = osc_share_group_snapshots.ShowShareGroupSnapshot(
@@ -336,7 +336,7 @@ class TestSetShareGroupSnapshot(TestShareGroupSnapshot):
def setUp(self):
super().setUp()
self.share_group_snapshot = manila_fakes.FakeShareGroupSnapshot.create_one_share_group_snapshot()
self.share_group_snapshot = manila_fakes.FakeShareGroupSnapshot.create_one_share_group_snapshot() # noqa: E501
self.group_snapshot_mocks.get.return_value = self.share_group_snapshot
self.cmd = osc_share_group_snapshots.SetShareGroupSnapshot(
@@ -408,7 +408,7 @@ class TestUnsetShareGroupSnapshot(TestShareGroupSnapshot):
def setUp(self):
super().setUp()
self.share_group_snapshot = manila_fakes.FakeShareGroupSnapshot.create_one_share_group_snapshot()
self.share_group_snapshot = manila_fakes.FakeShareGroupSnapshot.create_one_share_group_snapshot() # noqa: E501
self.group_snapshot_mocks.get.return_value = self.share_group_snapshot
self.cmd = osc_share_group_snapshots.UnsetShareGroupSnapshot(
@@ -463,7 +463,7 @@ class TestListShareGroupSnapshot(TestShareGroupSnapshot):
self.share_group = manila_fakes.FakeShareGroup.create_one_share_group()
self.groups_mock.get.return_value = self.share_group
self.share_group_snapshot = manila_fakes.FakeShareGroupSnapshot.create_one_share_group_snapshot(
self.share_group_snapshot = manila_fakes.FakeShareGroupSnapshot.create_one_share_group_snapshot( # noqa: E501
{'share_group_id': self.share_group.id}
)
@@ -593,7 +593,7 @@ class TestListShareGroupSnapshotMembers(TestShareGroupSnapshot):
self.share = manila_fakes.FakeShare.create_one_share()
self.share_group_snapshot = manila_fakes.FakeShareGroupSnapshot.create_one_share_group_snapshot(
self.share_group_snapshot = manila_fakes.FakeShareGroupSnapshot.create_one_share_group_snapshot( # noqa: E501
{'members': [{'share_id': self.share.id, 'size': self.share.size}]}
)

View File

@@ -53,7 +53,7 @@ class TestShareInstanceExportLocationList(TestShareInstanceExportLocation):
)
self.instances_mock.get.return_value = self.instance
self.instance_export_locations = manila_fakes.FakeShareExportLocation.create_share_export_locations()
self.instance_export_locations = manila_fakes.FakeShareExportLocation.create_share_export_locations() # noqa: E501
self.instance_export_locations_mock.list.return_value = (
self.instance_export_locations
)
@@ -63,7 +63,7 @@ class TestShareInstanceExportLocationList(TestShareInstanceExportLocation):
for i in self.instance_export_locations
)
self.cmd = osc_share_instance_export_locations.ShareInstanceListExportLocation(
self.cmd = osc_share_instance_export_locations.ShareInstanceListExportLocation( # noqa: E501
self.app, None
)
@@ -114,7 +114,7 @@ class TestShareInstanceExportLocationShow(TestShareInstanceExportLocation):
)
self.instances_mock.get.return_value = self.instance
self.cmd = osc_share_instance_export_locations.ShareInstanceShowExportLocation(
self.cmd = osc_share_instance_export_locations.ShareInstanceShowExportLocation( # noqa: E501
self.app, None
)

View File

@@ -124,9 +124,8 @@ class TestShareInstanceList(TestShareInstance):
fake_export_location = '10.1.1.0:/fake_share_el'
argslist = ['--export-location', fake_export_location]
verifylist = [('export_location', fake_export_location)]
self.app.client_manager.share.api_version = api_versions.APIVersion(
'2.34'
)
api_version = api_versions.APIVersion('2.34')
self.app.client_manager.share.api_version = api_version
parsed_args = self.check_parser(self.cmd, argslist, verifylist)

View File

@@ -860,7 +860,7 @@ class TestShareNetworkSet(TestShareNetwork):
def test_set_share_network_update_security_service_check_reset(
self, check_only, restart_check
):
self.share_networks_mock.update_share_network_security_service_check = mock.Mock(
self.share_networks_mock.update_share_network_security_service_check = mock.Mock( # noqa: E501
return_value=(200, {'compatible': True})
)

View File

@@ -15,9 +15,7 @@
from osc_lib import utils as osc_lib_utils
from manilaclient.osc.v2 import (
share_snapshot_instance_export_locations as osc_snapshot_instance_locations,
)
from manilaclient.osc.v2 import share_snapshot_instance_export_locations
from manilaclient.tests.unit.osc import osc_utils
from manilaclient.tests.unit.osc.v2 import fakes as manila_fakes
@@ -33,7 +31,9 @@ class TestShareSnapshotInstanceExportLocation(manila_fakes.TestShare):
)
self.share_snapshot_instances_mock.reset_mock()
self.share_snapshot_instances_el_mock = self.app.client_manager.share.share_snapshot_instance_export_locations
self.share_snapshot_instances_el_mock = (
self.app.client_manager.share.share_snapshot_instance_export_locations # noqa: E501
)
self.share_snapshot_instances_el_mock.reset_mock()
@@ -43,9 +43,9 @@ class TestShareSnapshotInstanceExportLocationList(
def setUp(self):
super().setUp()
self.share_snapshot_instance = manila_fakes.FakeShareSnapshotIntances.create_one_snapshot_instance()
self.share_snapshot_instance = manila_fakes.FakeShareSnapshotIntances.create_one_snapshot_instance() # noqa: E501
self.share_snapshot_instances_export_locations = manila_fakes.FakeShareSnapshotInstancesExportLocations.create_share_snapshot_instances(
self.share_snapshot_instances_export_locations = manila_fakes.FakeShareSnapshotInstancesExportLocations.create_share_snapshot_instances( # noqa: E501
count=2
)
@@ -57,7 +57,7 @@ class TestShareSnapshotInstanceExportLocationList(
self.share_snapshot_instances_export_locations
)
self.cmd = osc_snapshot_instance_locations.ShareSnapshotInstanceExportLocationList(
self.cmd = share_snapshot_instance_export_locations.ShareSnapshotInstanceExportLocationList( # noqa: E501
self.app, None
)
@@ -94,9 +94,11 @@ class TestShareSnapshotInstanceExportLocationShow(
def setUp(self):
super().setUp()
self.share_snapshot_instance = manila_fakes.FakeShareSnapshotIntances.create_one_snapshot_instance()
self.share_snapshot_instance = manila_fakes.FakeShareSnapshotIntances.create_one_snapshot_instance() # noqa: E501
self.share_snapshot_instances_export_location = manila_fakes.FakeShareSnapshotInstancesExportLocations.create_one_snapshot_instance()
self.share_snapshot_instances_export_location = (
manila_fakes.FakeShareSnapshotInstancesExportLocations.create_one_snapshot_instance() # noqa: E501
)
self.share_snapshot_instances_mock.get.return_value = (
self.share_snapshot_instance
@@ -106,7 +108,7 @@ class TestShareSnapshotInstanceExportLocationShow(
self.share_snapshot_instances_export_location
)
self.cmd = osc_snapshot_instance_locations.ShareSnapshotInstanceExportLocationShow(
self.cmd = share_snapshot_instance_export_locations.ShareSnapshotInstanceExportLocationShow( # noqa: E501
self.app, None
)

View File

@@ -53,7 +53,9 @@ class TestShareSnapshotInstance(manila_fakes.TestShare):
)
self.share_snapshot_instances_mock.reset_mock()
self.share_snapshot_instances_el_mock = self.app.client_manager.share.share_snapshot_instance_export_locations
self.share_snapshot_instances_el_mock = (
self.app.client_manager.share.share_snapshot_instance_export_locations # noqa: E501
)
self.share_snapshot_instances_el_mock.reset_mock()
@@ -61,7 +63,7 @@ class TestShareSnapshotInstanceList(TestShareSnapshotInstance):
def setUp(self):
super().setUp()
self.share_snapshot_instances = manila_fakes.FakeShareSnapshotIntances.create_share_snapshot_instances(
self.share_snapshot_instances = manila_fakes.FakeShareSnapshotIntances.create_share_snapshot_instances( # noqa: E501
count=2
)
@@ -136,13 +138,13 @@ class TestShareSnapshotInstanceShow(TestShareSnapshotInstance):
def setUp(self):
super().setUp()
self.share_snapshot_instance = manila_fakes.FakeShareSnapshotIntances.create_one_snapshot_instance()
self.share_snapshot_instance = manila_fakes.FakeShareSnapshotIntances.create_one_snapshot_instance() # noqa: E501
self.share_snapshot_instances_mock.get.return_value = (
self.share_snapshot_instance
)
self.share_snapshot_instances_el_list = manila_fakes.FakeShareSnapshotInstancesExportLocations.create_share_snapshot_instances(
self.share_snapshot_instances_el_list = manila_fakes.FakeShareSnapshotInstancesExportLocations.create_share_snapshot_instances( # noqa: E501
count=2
)
@@ -192,7 +194,7 @@ class TestShareSnapshotInstanceSet(TestShareSnapshotInstance):
def setUp(self):
super().setUp()
self.share_snapshot_instance = manila_fakes.FakeShareSnapshotIntances.create_one_snapshot_instance()
self.share_snapshot_instance = manila_fakes.FakeShareSnapshotIntances.create_one_snapshot_instance() # noqa: E501
self.snapshot_instance_status = 'available'

View File

@@ -1243,7 +1243,9 @@ class FakeHTTPClient(fakes.FakeHTTPClient):
{
'share_type_access': [
{
'share_type_id': '11111111-1111-1111-1111-111111111111',
'share_type_id': (
'11111111-1111-1111-1111-111111111111'
),
'project_id': '00000000-0000-0000-0000-000000000000',
}
]

View File

@@ -263,7 +263,7 @@ class Client:
self
)
)
self.share_snapshot_instance_export_locations = share_snapshot_instance_export_locations.ShareSnapshotInstanceExportLocationManager(
self.share_snapshot_instance_export_locations = share_snapshot_instance_export_locations.ShareSnapshotInstanceExportLocationManager( # noqa: E501
self
)

View File

@@ -2628,8 +2628,11 @@ def do_snapshot_access_list(cs, args):
type=str,
default=None,
action='single_alias',
help=f'Key to be sorted, available keys are {constants.SHARE_SORT_KEY_VALUES}. '
'OPTIONAL: Default=None.',
help=(
f'Key to be sorted, available keys are '
f'{constants.SHARE_SORT_KEY_VALUES}. '
'OPTIONAL: Default=None.'
),
)
@cliutils.arg(
'--sort-dir',
@@ -3158,8 +3161,11 @@ def do_share_instance_export_location_show(cs, args):
type=str,
default=None,
action='single_alias',
help=f'Key to be sorted, available keys are {constants.SNAPSHOT_SORT_KEY_VALUES}. '
'Default=None.',
help=(
f'Key to be sorted, available keys are '
f'{constants.SNAPSHOT_SORT_KEY_VALUES}. '
'Default=None.'
),
)
@cliutils.arg(
'--sort-dir',
@@ -6497,7 +6503,10 @@ def do_share_group_create(cs, args):
type=str,
default=None,
action='single_alias',
help=f'Key to be sorted, available keys are {constants.SHARE_GROUP_SORT_KEY_VALUES}. Default=None.',
help=(
f'Key to be sorted, available keys are '
f'{constants.SHARE_GROUP_SORT_KEY_VALUES}. Default=None.'
),
)
@cliutils.arg(
'--sort-dir',
@@ -6819,7 +6828,10 @@ def do_share_group_snapshot_create(cs, args):
type=str,
default=None,
action='single_alias',
help=f'Key to be sorted, available keys are {constants.SHARE_GROUP_SNAPSHOT_SORT_KEY_VALUES}. Default=None.',
help=(
f'Key to be sorted, available keys are '
f'{constants.SHARE_GROUP_SNAPSHOT_SORT_KEY_VALUES}. Default=None.'
),
)
@cliutils.arg(
'--sort-dir',
@@ -7593,7 +7605,10 @@ def do_share_transfer_accept(cs, args):
type=str,
default=None,
action='single_alias',
help=f'Key to be sorted, available keys are {constants.SHARE_TRANSFER_SORT_KEY_VALUES}. Default=None.',
help=(
f'Key to be sorted, available keys are '
f'{constants.SHARE_TRANSFER_SORT_KEY_VALUES}. Default=None.'
),
)
@cliutils.arg(
'--sort-dir',
@@ -7761,7 +7776,10 @@ def do_share_transfer_show(cs, args):
type=str,
default=None,
action='single_alias',
help=f'Key to be sorted, available keys are {constants.MESSAGE_SORT_KEY_VALUES}. Default=desc.',
help=(
f'Key to be sorted, available keys are '
f'{constants.MESSAGE_SORT_KEY_VALUES}. Default=desc.'
),
)
@cliutils.arg(
'--sort-dir',

View File

@@ -207,7 +207,7 @@ quote-style = "preserve"
docstring-code-format = true
[tool.ruff.lint]
select = ["E4", "E7", "E9", "F", "S", "U"]
select = ["E4", "E5", "E7", "E9", "F", "S", "U"]
[tool.ruff.lint.per-file-ignores]
"manilaclient/tests/*" = ["S"]