From 290bc580e6576c7dc4843dca2b7374f6ccd6a8d0 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Wed, 19 Feb 2025 20:15:43 +0000 Subject: [PATCH] Prepare for ruff bump Change-Id: Ia9c402edebc8537d5019d18920b6679b05ea4378 Signed-off-by: Stephen Finucane --- openstackclient/compute/v2/agent.py | 2 +- openstackclient/compute/v2/aggregate.py | 7 +-- openstackclient/compute/v2/flavor.py | 16 +++---- openstackclient/compute/v2/keypair.py | 4 +- openstackclient/compute/v2/server.py | 11 ++--- openstackclient/compute/v2/service.py | 12 ++--- openstackclient/compute/v2/usage.py | 6 +-- openstackclient/identity/client.py | 3 +- openstackclient/identity/common.py | 2 +- openstackclient/identity/v2_0/ec2creds.py | 7 +-- openstackclient/identity/v2_0/endpoint.py | 7 +-- openstackclient/identity/v2_0/project.py | 7 +-- openstackclient/identity/v2_0/role.py | 2 +- openstackclient/identity/v2_0/service.py | 9 ++-- openstackclient/identity/v2_0/user.py | 2 +- openstackclient/identity/v3/access_rule.py | 7 +-- openstackclient/identity/v3/consumer.py | 7 +-- openstackclient/identity/v3/credential.py | 13 +++--- openstackclient/identity/v3/domain.py | 2 +- openstackclient/identity/v3/ec2creds.py | 7 +-- openstackclient/identity/v3/endpoint.py | 17 ++++--- openstackclient/identity/v3/endpoint_group.py | 2 +- openstackclient/identity/v3/group.py | 2 +- .../identity/v3/identity_provider.py | 3 +- openstackclient/identity/v3/limit.py | 4 +- openstackclient/identity/v3/mapping.py | 7 +-- openstackclient/identity/v3/policy.py | 4 +- openstackclient/identity/v3/project.py | 7 +-- openstackclient/identity/v3/region.py | 7 +-- .../identity/v3/registered_limit.py | 3 +- openstackclient/identity/v3/role.py | 4 +- openstackclient/identity/v3/service.py | 7 +-- .../identity/v3/service_provider.py | 9 ++-- openstackclient/identity/v3/tag.py | 4 +- openstackclient/identity/v3/token.py | 3 +- openstackclient/identity/v3/trust.py | 2 +- openstackclient/identity/v3/user.py | 2 +- openstackclient/image/v1/image.py | 3 +- openstackclient/image/v2/cache.py | 6 +-- openstackclient/image/v2/image.py | 19 +++----- .../image/v2/metadef_namespaces.py | 7 +-- openstackclient/network/client.py | 4 +- openstackclient/network/common.py | 3 +- openstackclient/network/v2/address_group.py | 11 ++--- openstackclient/network/v2/address_scope.py | 5 +-- openstackclient/network/v2/floating_ip.py | 15 ++----- .../network/v2/floating_ip_port_forwarding.py | 2 +- .../network/v2/l3_conntrack_helper.py | 9 ++-- openstackclient/network/v2/local_ip.py | 21 ++++----- .../network/v2/local_ip_association.py | 6 +-- openstackclient/network/v2/ndp_proxy.py | 4 +- openstackclient/network/v2/network.py | 7 +-- openstackclient/network/v2/network_agent.py | 2 +- .../network/v2/network_flavor_profile.py | 2 +- openstackclient/network/v2/network_meter.py | 4 +- .../network/v2/network_meter_rule.py | 7 +-- .../network/v2/network_qos_policy.py | 2 +- openstackclient/network/v2/network_rbac.py | 2 +- openstackclient/network/v2/network_segment.py | 2 +- .../network/v2/network_segment_range.py | 11 ++--- openstackclient/network/v2/network_trunk.py | 2 +- openstackclient/network/v2/port.py | 5 +-- openstackclient/network/v2/router.py | 4 +- openstackclient/network/v2/security_group.py | 5 +-- .../network/v2/security_group_rule.py | 2 +- openstackclient/network/v2/subnet.py | 4 +- openstackclient/network/v2/subnet_pool.py | 4 +- .../functional/compute/v2/test_server.py | 5 +-- .../compute/v2/test_server_event.py | 2 +- .../tests/functional/identity/v2/test_user.py | 2 +- .../tests/functional/identity/v3/common.py | 11 ++--- .../v3/test_application_credential.py | 20 ++++----- .../functional/identity/v3/test_endpoint.py | 6 +-- .../functional/identity/v3/test_group.py | 6 +-- .../functional/identity/v3/test_limit.py | 8 ++-- .../functional/identity/v3/test_project.py | 19 +++----- .../functional/identity/v3/test_region.py | 4 +- .../identity/v3/test_registered_limit.py | 6 +-- .../tests/functional/identity/v3/test_role.py | 2 +- .../identity/v3/test_role_assignment.py | 44 ++++++------------- .../tests/functional/identity/v3/test_user.py | 16 +++---- .../network/v2/test_l3_conntrack_helper.py | 3 +- .../network/v2/test_network_ndp_proxy.py | 5 +-- .../network/v2/test_network_trunk.py | 2 +- .../tests/functional/network/v2/test_port.py | 10 ++--- .../tests/unit/common/test_command.py | 2 +- .../tests/unit/compute/v2/test_server.py | 4 +- .../tests/unit/identity/v2_0/fakes.py | 2 +- .../unit/identity/v3/test_access_rule.py | 4 +- .../v3/test_application_credential.py | 2 +- .../tests/unit/identity/v3/test_mappings.py | 4 +- .../tests/unit/integ/cli/test_shell.py | 3 +- .../unit/network/v2/test_network_trunk.py | 4 +- .../tests/unit/network/v2/test_port.py | 5 +-- .../tests/unit/object/v1/test_object_all.py | 7 +-- .../unit/volume/v1/test_transfer_request.py | 2 +- .../tests/unit/volume/v1/test_type.py | 2 +- .../tests/unit/volume/v2/test_volume.py | 2 +- .../volume/v2/test_volume_transfer_request.py | 2 +- .../tests/unit/volume/v3/test_volume.py | 2 +- .../unit/volume/v3/test_volume_snapshot.py | 3 +- .../volume/v3/test_volume_transfer_request.py | 2 +- openstackclient/volume/client.py | 4 +- openstackclient/volume/v1/qos_specs.py | 3 +- openstackclient/volume/v1/volume.py | 17 +++---- openstackclient/volume/v1/volume_backup.py | 5 +-- openstackclient/volume/v1/volume_snapshot.py | 15 +++---- openstackclient/volume/v1/volume_type.py | 9 ++-- .../volume/v2/consistency_group.py | 12 ++--- .../volume/v2/consistency_group_snapshot.py | 3 +- openstackclient/volume/v2/qos_specs.py | 3 +- openstackclient/volume/v2/volume.py | 22 +++------- openstackclient/volume/v2/volume_backup.py | 3 +- openstackclient/volume/v2/volume_snapshot.py | 17 ++++--- openstackclient/volume/v2/volume_type.py | 27 ++++-------- .../volume/v3/block_storage_manage.py | 4 +- openstackclient/volume/v3/volume.py | 19 +++----- openstackclient/volume/v3/volume_backup.py | 3 +- openstackclient/volume/v3/volume_snapshot.py | 7 +-- openstackclient/volume/v3/volume_type.py | 27 ++++-------- 120 files changed, 333 insertions(+), 490 deletions(-) diff --git a/openstackclient/compute/v2/agent.py b/openstackclient/compute/v2/agent.py index 8f897ca8af..799b828bb2 100644 --- a/openstackclient/compute/v2/agent.py +++ b/openstackclient/compute/v2/agent.py @@ -114,7 +114,7 @@ class DeleteAgent(command.Command): if result > 0: total = len(parsed_args.id) - msg = _("%(result)s of %(total)s agents failed " "to delete.") % { + msg = _("%(result)s of %(total)s agents failed to delete.") % { 'result': result, 'total': total, } diff --git a/openstackclient/compute/v2/aggregate.py b/openstackclient/compute/v2/aggregate.py index 4cbce3c814..167b2e82c9 100644 --- a/openstackclient/compute/v2/aggregate.py +++ b/openstackclient/compute/v2/aggregate.py @@ -168,9 +168,10 @@ class DeleteAggregate(command.Command): if result > 0: total = len(parsed_args.aggregate) - msg = _( - "%(result)s of %(total)s aggregates failed " "to delete." - ) % {'result': result, 'total': total} + msg = _("%(result)s of %(total)s aggregates failed to delete.") % { + 'result': result, + 'total': total, + } raise exceptions.CommandError(msg) diff --git a/openstackclient/compute/v2/flavor.py b/openstackclient/compute/v2/flavor.py index f94b3162e4..03092417ca 100644 --- a/openstackclient/compute/v2/flavor.py +++ b/openstackclient/compute/v2/flavor.py @@ -190,8 +190,7 @@ class CreateFlavor(command.ShowOne): compute_client.flavor_add_tenant_access(flavor.id, project_id) except Exception as e: msg = _( - "Failed to add project %(project)s access to " - "flavor: %(e)s" + "Failed to add project %(project)s access to flavor: %(e)s" ) LOG.error(msg, {'project': parsed_args.project, 'e': e}) if parsed_args.properties: @@ -242,7 +241,7 @@ class DeleteFlavor(command.Command): if result > 0: total = len(parsed_args.flavor) - msg = _("%(result)s of %(total)s flavors failed " "to delete.") % { + msg = _("%(result)s of %(total)s flavors failed to delete.") % { 'result': result, 'total': total, } @@ -404,9 +403,7 @@ class SetFlavor(command.Command): parser.add_argument( '--project', metavar='', - help=_( - 'Set flavor access to project (name or ID) ' '(admin only)' - ), + help=_('Set flavor access to project (name or ID) (admin only)'), ) identity_common.add_project_domain_option_to_parser(parser) parser.add_argument( @@ -483,7 +480,7 @@ class SetFlavor(command.Command): if result > 0: raise exceptions.CommandError( - _("Command Failed: One or more of" " the operations failed") + _("Command Failed: One or more of the operations failed") ) @@ -560,8 +557,7 @@ class UnsetFlavor(command.Command): '--project', metavar='', help=_( - 'Remove flavor access from project (name or ID) ' - '(admin only)' + 'Remove flavor access from project (name or ID) (admin only)' ), ) identity_common.add_project_domain_option_to_parser(parser) @@ -612,5 +608,5 @@ class UnsetFlavor(command.Command): if result > 0: raise exceptions.CommandError( - _("Command Failed: One or more of" " the operations failed") + _("Command Failed: One or more of the operations failed") ) diff --git a/openstackclient/compute/v2/keypair.py b/openstackclient/compute/v2/keypair.py index 8e43899539..377eb903c0 100644 --- a/openstackclient/compute/v2/keypair.py +++ b/openstackclient/compute/v2/keypair.py @@ -258,13 +258,13 @@ class DeleteKeypair(command.Command): except Exception as e: result += 1 LOG.error( - _("Failed to delete key with name " "'%(name)s': %(e)s"), + _("Failed to delete key with name '%(name)s': %(e)s"), {'name': n, 'e': e}, ) if result > 0: total = len(parsed_args.name) - msg = _("%(result)s of %(total)s keys failed " "to delete.") % { + msg = _("%(result)s of %(total)s keys failed to delete.") % { 'result': result, 'total': total, } diff --git a/openstackclient/compute/v2/server.py b/openstackclient/compute/v2/server.py index dcadca1b65..244c72a45e 100644 --- a/openstackclient/compute/v2/server.py +++ b/openstackclient/compute/v2/server.py @@ -1617,8 +1617,7 @@ class CreateServer(command.ShowOne): image = images[0] else: msg = _( - 'No images match the property expected by ' - '--image-property' + 'No images match the property expected by --image-property' ) raise exceptions.CommandError(msg) @@ -1902,7 +1901,7 @@ class CreateServer(command.ShowOne): # Default to empty list if nothing was specified and let nova # decide the default behavior. - networks: ty.Union[str, ty.List[ty.Dict[str, str]], None] = [] + networks: ty.Union[str, list[dict[str, str]], None] = [] if 'auto' in parsed_args.nics or 'none' in parsed_args.nics: if len(parsed_args.nics) > 1: @@ -2424,8 +2423,7 @@ class ListServer(command.Lister): parser.add_argument( '--key-name', help=_( - 'Search by keypair name ' - '(admin only before microversion 2.83)' + 'Search by keypair name (admin only before microversion 2.83)' ), ) config_drive_group = parser.add_mutually_exclusive_group() @@ -4475,8 +4473,7 @@ class SetServer(command.Command): password_group.add_argument( '--password', help=_( - 'Set the server password. ' - 'This option requires cloud support.' + 'Set the server password. This option requires cloud support.' ), ) password_group.add_argument( diff --git a/openstackclient/compute/v2/service.py b/openstackclient/compute/v2/service.py index b96386e033..b0d77fbade 100644 --- a/openstackclient/compute/v2/service.py +++ b/openstackclient/compute/v2/service.py @@ -70,7 +70,7 @@ class DeleteService(command.Command): if result > 0: total = len(parsed_args.service) msg = _( - "%(result)s of %(total)s compute services failed " "to delete." + "%(result)s of %(total)s compute services failed to delete." ) % {'result': result, 'total': total} raise exceptions.CommandError(msg) @@ -153,8 +153,7 @@ class SetService(command.Command): "service", metavar="", help=_( - "Name of service (Binary name), for example " - "``nova-compute``" + "Name of service (Binary name), for example ``nova-compute``" ), ) enabled_group = parser.add_mutually_exclusive_group() @@ -281,9 +280,7 @@ class SetService(command.Command): force_down = False if force_down is not None: if not sdk_utils.supports_microversion(compute_client, '2.11'): - msg = _( - '--os-compute-api-version 2.11 or later is ' 'required' - ) + msg = _('--os-compute-api-version 2.11 or later is required') raise exceptions.CommandError(msg) try: compute_client.update_service_forced_down( @@ -299,7 +296,6 @@ class SetService(command.Command): if result > 0: msg = _( - "Compute service %(service)s of host %(host)s failed to " - "set." + "Compute service %(service)s of host %(host)s failed to set." ) % {"service": parsed_args.service, "host": parsed_args.host} raise exceptions.CommandError(msg) diff --git a/openstackclient/compute/v2/usage.py b/openstackclient/compute/v2/usage.py index 5d91358b97..b4bfedac99 100644 --- a/openstackclient/compute/v2/usage.py +++ b/openstackclient/compute/v2/usage.py @@ -115,8 +115,7 @@ class ListUsage(command.Lister): metavar="", default=None, help=_( - "Usage range start date, ex 2012-01-20" - " (default: 4 weeks ago)" + "Usage range start date, ex 2012-01-20 (default: 4 weeks ago)" ), ) parser.add_argument( @@ -222,8 +221,7 @@ class ShowUsage(command.ShowOne): metavar="", default=None, help=_( - "Usage range start date, ex 2012-01-20" - " (default: 4 weeks ago)" + "Usage range start date, ex 2012-01-20 (default: 4 weeks ago)" ), ) parser.add_argument( diff --git a/openstackclient/identity/client.py b/openstackclient/identity/client.py index 5ed81e580f..013c599da0 100644 --- a/openstackclient/identity/client.py +++ b/openstackclient/identity/client.py @@ -64,8 +64,7 @@ def build_option_parser(parser): metavar='', default=utils.env('OS_IDENTITY_API_VERSION'), help=_( - 'Identity API version, default=%s ' - '(Env: OS_IDENTITY_API_VERSION)' + 'Identity API version, default=%s (Env: OS_IDENTITY_API_VERSION)' ) % DEFAULT_API_VERSION, ) diff --git a/openstackclient/identity/common.py b/openstackclient/identity/common.py index 9f4402f5b5..9a7f11d1a1 100644 --- a/openstackclient/identity/common.py +++ b/openstackclient/identity/common.py @@ -335,7 +335,7 @@ def add_inherited_option_to_parser(parser): action='store_true', default=False, help=_( - 'Specifies if the role grant is inheritable to the sub ' 'projects' + 'Specifies if the role grant is inheritable to the sub projects' ), ) diff --git a/openstackclient/identity/v2_0/ec2creds.py b/openstackclient/identity/v2_0/ec2creds.py index 6970f46dc9..25ee8a75d4 100644 --- a/openstackclient/identity/v2_0/ec2creds.py +++ b/openstackclient/identity/v2_0/ec2creds.py @@ -128,9 +128,10 @@ class DeleteEC2Creds(command.Command): if result > 0: total = len(parsed_args.access_keys) - msg = _( - "%(result)s of %(total)s EC2 keys failed " "to delete." - ) % {'result': result, 'total': total} + msg = _("%(result)s of %(total)s EC2 keys failed to delete.") % { + 'result': result, + 'total': total, + } raise exceptions.CommandError(msg) diff --git a/openstackclient/identity/v2_0/endpoint.py b/openstackclient/identity/v2_0/endpoint.py index ca11164b61..94edc4cbe6 100644 --- a/openstackclient/identity/v2_0/endpoint.py +++ b/openstackclient/identity/v2_0/endpoint.py @@ -111,9 +111,10 @@ class DeleteEndpoint(command.Command): if result > 0: total = len(parsed_args.endpoints) - msg = _( - "%(result)s of %(total)s endpoints failed " "to delete." - ) % {'result': result, 'total': total} + msg = _("%(result)s of %(total)s endpoints failed to delete.") % { + 'result': result, + 'total': total, + } raise exceptions.CommandError(msg) diff --git a/openstackclient/identity/v2_0/project.py b/openstackclient/identity/v2_0/project.py index 8920e0e16a..1acaa29e58 100644 --- a/openstackclient/identity/v2_0/project.py +++ b/openstackclient/identity/v2_0/project.py @@ -140,9 +140,10 @@ class DeleteProject(command.Command): if errors > 0: total = len(parsed_args.projects) - msg = _( - "%(errors)s of %(total)s projects failed " "to delete." - ) % {'errors': errors, 'total': total} + msg = _("%(errors)s of %(total)s projects failed to delete.") % { + 'errors': errors, + 'total': total, + } raise exceptions.CommandError(msg) diff --git a/openstackclient/identity/v2_0/role.py b/openstackclient/identity/v2_0/role.py index 971c61a7f7..1faab2e5ac 100644 --- a/openstackclient/identity/v2_0/role.py +++ b/openstackclient/identity/v2_0/role.py @@ -143,7 +143,7 @@ class DeleteRole(command.Command): if errors > 0: total = len(parsed_args.roles) - msg = _("%(errors)s of %(total)s roles failed " "to delete.") % { + msg = _("%(errors)s of %(total)s roles failed to delete.") % { 'errors': errors, 'total': total, } diff --git a/openstackclient/identity/v2_0/service.py b/openstackclient/identity/v2_0/service.py index 362dc45150..465f002b1f 100644 --- a/openstackclient/identity/v2_0/service.py +++ b/openstackclient/identity/v2_0/service.py @@ -100,9 +100,10 @@ class DeleteService(command.Command): if result > 0: total = len(parsed_args.services) - msg = _( - "%(result)s of %(total)s services failed " "to delete." - ) % {'result': result, 'total': total} + msg = _("%(result)s of %(total)s services failed to delete.") % { + 'result': result, + 'total': total, + } raise exceptions.CommandError(msg) @@ -164,7 +165,7 @@ class ShowService(command.ShowOne): return zip(*sorted(info.items())) msg = _( - "No service catalog with a type, name or ID of '%s' " "exists." + "No service catalog with a type, name or ID of '%s' exists." ) % (parsed_args.service) raise exceptions.CommandError(msg) else: diff --git a/openstackclient/identity/v2_0/user.py b/openstackclient/identity/v2_0/user.py index 3625adc7c6..b48c95e27d 100644 --- a/openstackclient/identity/v2_0/user.py +++ b/openstackclient/identity/v2_0/user.py @@ -194,7 +194,7 @@ class DeleteUser(command.Command): if errors > 0: total = len(parsed_args.users) - msg = _("%(errors)s of %(total)s users failed " "to delete.") % { + msg = _("%(errors)s of %(total)s users failed to delete.") % { 'errors': errors, 'total': total, } diff --git a/openstackclient/identity/v3/access_rule.py b/openstackclient/identity/v3/access_rule.py index 40bb4cc113..367c649019 100644 --- a/openstackclient/identity/v3/access_rule.py +++ b/openstackclient/identity/v3/access_rule.py @@ -54,17 +54,14 @@ class DeleteAccessRule(command.Command): except Exception as e: errors += 1 LOG.error( - _( - "Failed to delete access rule with " - "ID '%(ac)s': %(e)s" - ), + _("Failed to delete access rule with ID '%(ac)s': %(e)s"), {'ac': ac, 'e': e}, ) if errors > 0: total = len(parsed_args.access_rule) msg = _( - "%(errors)s of %(total)s access rules failed " "to delete." + "%(errors)s of %(total)s access rules failed to delete." ) % {'errors': errors, 'total': total} raise exceptions.CommandError(msg) diff --git a/openstackclient/identity/v3/consumer.py b/openstackclient/identity/v3/consumer.py index 924b5726d2..933f48aa74 100644 --- a/openstackclient/identity/v3/consumer.py +++ b/openstackclient/identity/v3/consumer.py @@ -82,9 +82,10 @@ class DeleteConsumer(command.Command): if result > 0: total = len(parsed_args.consumer) - msg = _( - "%(result)s of %(total)s consumers failed " "to delete." - ) % {'result': result, 'total': total} + msg = _("%(result)s of %(total)s consumers failed to delete.") % { + 'result': result, + 'total': total, + } raise exceptions.CommandError(msg) diff --git a/openstackclient/identity/v3/credential.py b/openstackclient/identity/v3/credential.py index 33297e9d19..7d9c7c46c2 100644 --- a/openstackclient/identity/v3/credential.py +++ b/openstackclient/identity/v3/credential.py @@ -70,8 +70,7 @@ class CreateCredential(command.ShowOne): '--project', metavar='', help=_( - 'Project which limits the scope of ' - 'the credential (name or ID)' + 'Project which limits the scope of the credential (name or ID)' ), ) return parser @@ -128,9 +127,10 @@ class DeleteCredential(command.Command): if result > 0: total = len(parsed_args.credential) - msg = _( - "%(result)s of %(total)s credential failed " "to delete." - ) % {'result': result, 'total': total} + msg = _("%(result)s of %(total)s credential failed to delete.") % { + 'result': result, + 'total': total, + } raise exceptions.CommandError(msg) @@ -219,8 +219,7 @@ class SetCredential(command.Command): '--project', metavar='', help=_( - 'Project which limits the scope of ' - 'the credential (name or ID)' + 'Project which limits the scope of the credential (name or ID)' ), ) return parser diff --git a/openstackclient/identity/v3/domain.py b/openstackclient/identity/v3/domain.py index aaa2708302..215f1be8be 100644 --- a/openstackclient/identity/v3/domain.py +++ b/openstackclient/identity/v3/domain.py @@ -124,7 +124,7 @@ class DeleteDomain(command.Command): if result > 0: total = len(parsed_args.domain) - msg = _("%(result)s of %(total)s domains failed " "to delete.") % { + msg = _("%(result)s of %(total)s domains failed to delete.") % { 'result': result, 'total': total, } diff --git a/openstackclient/identity/v3/ec2creds.py b/openstackclient/identity/v3/ec2creds.py index a9fbe1ae4e..84700f496d 100644 --- a/openstackclient/identity/v3/ec2creds.py +++ b/openstackclient/identity/v3/ec2creds.py @@ -156,9 +156,10 @@ class DeleteEC2Creds(command.Command): if result > 0: total = len(parsed_args.access_key) - msg = _( - "%(result)s of %(total)s EC2 keys failed " "to delete." - ) % {'result': result, 'total': total} + msg = _("%(result)s of %(total)s EC2 keys failed to delete.") % { + 'result': result, + 'total': total, + } raise exceptions.CommandError(msg) diff --git a/openstackclient/identity/v3/endpoint.py b/openstackclient/identity/v3/endpoint.py index 6e77bdf871..72dd515704 100644 --- a/openstackclient/identity/v3/endpoint.py +++ b/openstackclient/identity/v3/endpoint.py @@ -44,15 +44,13 @@ class AddProjectToEndpoint(command.Command): 'endpoint', metavar='', help=_( - 'Endpoint to associate with ' 'specified project (name or ID)' + 'Endpoint to associate with specified project (name or ID)' ), ) parser.add_argument( 'project', metavar='', - help=_( - 'Project to associate with ' 'specified endpoint name or ID)' - ), + help=_('Project to associate with specified endpoint name or ID)'), ) common.add_project_domain_option_to_parser(parser) return parser @@ -167,9 +165,10 @@ class DeleteEndpoint(command.Command): if result > 0: total = len(parsed_args.endpoint) - msg = _( - "%(result)s of %(total)s endpoints failed " "to delete." - ) % {'result': result, 'total': total} + msg = _("%(result)s of %(total)s endpoints failed to delete.") % { + 'result': result, + 'total': total, + } raise exceptions.CommandError(msg) @@ -290,14 +289,14 @@ class RemoveProjectFromEndpoint(command.Command): 'endpoint', metavar='', help=_( - 'Endpoint to dissociate from ' 'specified project (name or ID)' + 'Endpoint to dissociate from specified project (name or ID)' ), ) parser.add_argument( 'project', metavar='', help=_( - 'Project to dissociate from ' 'specified endpoint name or ID)' + 'Project to dissociate from specified endpoint name or ID)' ), ) common.add_project_domain_option_to_parser(parser) diff --git a/openstackclient/identity/v3/endpoint_group.py b/openstackclient/identity/v3/endpoint_group.py index b5c2631f02..e4611a1673 100644 --- a/openstackclient/identity/v3/endpoint_group.py +++ b/openstackclient/identity/v3/endpoint_group.py @@ -168,7 +168,7 @@ class DeleteEndpointGroup(command.Command): if result > 0: total = len(parsed_args.endpointgroup) msg = _( - "%(result)s of %(total)s endpointgroups failed " "to delete." + "%(result)s of %(total)s endpointgroups failed to delete." ) % {'result': result, 'total': total} raise exceptions.CommandError(msg) diff --git a/openstackclient/identity/v3/group.py b/openstackclient/identity/v3/group.py index d9c3b93b8f..62a5c22391 100644 --- a/openstackclient/identity/v3/group.py +++ b/openstackclient/identity/v3/group.py @@ -230,7 +230,7 @@ class DeleteGroup(command.Command): if errors > 0: total = len(parsed_args.groups) - msg = _("%(errors)s of %(total)s groups failed " "to delete.") % { + msg = _("%(errors)s of %(total)s groups failed to delete.") % { 'errors': errors, 'total': total, } diff --git a/openstackclient/identity/v3/identity_provider.py b/openstackclient/identity/v3/identity_provider.py index dad7165696..d0c3243628 100644 --- a/openstackclient/identity/v3/identity_provider.py +++ b/openstackclient/identity/v3/identity_provider.py @@ -174,8 +174,7 @@ class DeleteIdentityProvider(command.Command): if result > 0: total = len(parsed_args.identity_provider) msg = _( - "%(result)s of %(total)s identity providers failed" - " to delete." + "%(result)s of %(total)s identity providers failed to delete." ) % {'result': result, 'total': total} raise exceptions.CommandError(msg) diff --git a/openstackclient/identity/v3/limit.py b/openstackclient/identity/v3/limit.py index 44a3f63569..333078d036 100644 --- a/openstackclient/identity/v3/limit.py +++ b/openstackclient/identity/v3/limit.py @@ -281,13 +281,13 @@ class DeleteLimit(command.Command): except Exception as e: errors += 1 LOG.error( - _("Failed to delete limit with ID " "'%(id)s': %(e)s"), + _("Failed to delete limit with ID '%(id)s': %(e)s"), {'id': limit_id, 'e': e}, ) if errors > 0: total = len(parsed_args.limit_id) - msg = _("%(errors)s of %(total)s limits failed to " "delete.") % { + msg = _("%(errors)s of %(total)s limits failed to delete.") % { 'errors': errors, 'total': total, } diff --git a/openstackclient/identity/v3/mapping.py b/openstackclient/identity/v3/mapping.py index ff8f2aa317..8c2d0bf8df 100644 --- a/openstackclient/identity/v3/mapping.py +++ b/openstackclient/identity/v3/mapping.py @@ -161,9 +161,10 @@ class DeleteMapping(command.Command): if result > 0: total = len(parsed_args.mapping) - msg = _( - "%(result)s of %(total)s mappings failed " "to delete." - ) % {'result': result, 'total': total} + msg = _("%(result)s of %(total)s mappings failed to delete.") % { + 'result': result, + 'total': total, + } raise exceptions.CommandError(msg) diff --git a/openstackclient/identity/v3/policy.py b/openstackclient/identity/v3/policy.py index 51428e8c92..a7e2a07d9e 100644 --- a/openstackclient/identity/v3/policy.py +++ b/openstackclient/identity/v3/policy.py @@ -92,9 +92,7 @@ class DeletePolicy(command.Command): if result > 0: total = len(parsed_args.policy) - msg = _( - "%(result)s of %(total)s policies failed " "to delete." - ) % { + msg = _("%(result)s of %(total)s policies failed to delete.") % { 'result': result, 'total': total, } diff --git a/openstackclient/identity/v3/project.py b/openstackclient/identity/v3/project.py index aa6f629495..250fde4c5d 100644 --- a/openstackclient/identity/v3/project.py +++ b/openstackclient/identity/v3/project.py @@ -190,9 +190,10 @@ class DeleteProject(command.Command): if errors > 0: total = len(parsed_args.projects) - msg = _( - "%(errors)s of %(total)s projects failed " "to delete." - ) % {'errors': errors, 'total': total} + msg = _("%(errors)s of %(total)s projects failed to delete.") % { + 'errors': errors, + 'total': total, + } raise exceptions.CommandError(msg) diff --git a/openstackclient/identity/v3/region.py b/openstackclient/identity/v3/region.py index faa2bc4141..40d3819819 100644 --- a/openstackclient/identity/v3/region.py +++ b/openstackclient/identity/v3/region.py @@ -92,16 +92,13 @@ class DeleteRegion(command.Command): except Exception as e: result += 1 LOG.error( - _( - "Failed to delete region with " - "ID '%(region)s': %(e)s" - ), + _("Failed to delete region with ID '%(region)s': %(e)s"), {'region': i, 'e': e}, ) if result > 0: total = len(parsed_args.region) - msg = _("%(result)s of %(total)s regions failed " "to delete.") % { + msg = _("%(result)s of %(total)s regions failed to delete.") % { 'result': result, 'total': total, } diff --git a/openstackclient/identity/v3/registered_limit.py b/openstackclient/identity/v3/registered_limit.py index 336151ddbf..630066f8ab 100644 --- a/openstackclient/identity/v3/registered_limit.py +++ b/openstackclient/identity/v3/registered_limit.py @@ -137,8 +137,7 @@ class DeleteRegisteredLimit(command.Command): if errors > 0: total = len(parsed_args.registered_limit_id) msg = _( - "%(errors)s of %(total)s registered limits failed to " - "delete." + "%(errors)s of %(total)s registered limits failed to delete." ) % {'errors': errors, 'total': total} raise exceptions.CommandError(msg) diff --git a/openstackclient/identity/v3/role.py b/openstackclient/identity/v3/role.py index a7fb6644b1..4364931b6f 100644 --- a/openstackclient/identity/v3/role.py +++ b/openstackclient/identity/v3/role.py @@ -402,7 +402,7 @@ class DeleteRole(command.Command): if errors > 0: total = len(parsed_args.roles) - msg = _("%(errors)s of %(total)s roles failed " "to delete.") % { + msg = _("%(errors)s of %(total)s roles failed to delete.") % { 'errors': errors, 'total': total, } @@ -449,7 +449,7 @@ class ListRole(command.Lister): class RemoveRole(command.Command): _description = _( - "Removes a role assignment from system/domain/project : " "user/group" + "Removes a role assignment from system/domain/project : user/group" ) def get_parser(self, prog_name): diff --git a/openstackclient/identity/v3/service.py b/openstackclient/identity/v3/service.py index 41faa25517..dd1bfa473d 100644 --- a/openstackclient/identity/v3/service.py +++ b/openstackclient/identity/v3/service.py @@ -135,9 +135,10 @@ class DeleteService(command.Command): if result > 0: total = len(parsed_args.service) - msg = _( - "%(result)s of %(total)s services failed " "to delete." - ) % {'result': result, 'total': total} + msg = _("%(result)s of %(total)s services failed to delete.") % { + 'result': result, + 'total': total, + } raise exceptions.CommandError(msg) diff --git a/openstackclient/identity/v3/service_provider.py b/openstackclient/identity/v3/service_provider.py index 1a7b02fadf..5b49cffaf7 100644 --- a/openstackclient/identity/v3/service_provider.py +++ b/openstackclient/identity/v3/service_provider.py @@ -77,8 +77,7 @@ class CreateServiceProvider(command.ShowOne): metavar='', required=True, help=_( - 'A service URL where SAML assertions are being sent ' - '(required)' + 'A service URL where SAML assertions are being sent (required)' ), ) @@ -155,8 +154,7 @@ class DeleteServiceProvider(command.Command): if result > 0: total = len(parsed_args.service_provider) msg = _( - "%(result)s of %(total)s service providers failed" - " to delete." + "%(result)s of %(total)s service providers failed to delete." ) % {'result': result, 'total': total} raise exceptions.CommandError(msg) @@ -204,8 +202,7 @@ class SetServiceProvider(command.ShowOne): '--auth-url', metavar='', help=_( - 'New Authentication URL of remote ' - 'federated service provider' + 'New Authentication URL of remote federated service provider' ), ) diff --git a/openstackclient/identity/v3/tag.py b/openstackclient/identity/v3/tag.py index ce1dfe8919..0909fd122b 100644 --- a/openstackclient/identity/v3/tag.py +++ b/openstackclient/identity/v3/tag.py @@ -83,7 +83,7 @@ def add_tag_option_to_parser_for_create(parser, resource_name): metavar='', default=[], help=_( - 'Tag to be added to the %s ' '(repeat option to set multiple tags)' + 'Tag to be added to the %s (repeat option to set multiple tags)' ) % resource_name, ) @@ -97,7 +97,7 @@ def add_tag_option_to_parser_for_set(parser, resource_name): metavar='', default=[], help=_( - 'Tag to be added to the %s ' '(repeat option to set multiple tags)' + 'Tag to be added to the %s (repeat option to set multiple tags)' ) % resource_name, ) diff --git a/openstackclient/identity/v3/token.py b/openstackclient/identity/v3/token.py index 8f2dc09405..5500ce1d85 100644 --- a/openstackclient/identity/v3/token.py +++ b/openstackclient/identity/v3/token.py @@ -136,8 +136,7 @@ class CreateRequestToken(command.ShowOne): '--project', metavar='', help=_( - 'Project that consumer wants to access (name or ID)' - ' (required)' + 'Project that consumer wants to access (name or ID) (required)' ), required=True, ) diff --git a/openstackclient/identity/v3/trust.py b/openstackclient/identity/v3/trust.py index 41d01fa7b8..df8e2f4ea5 100644 --- a/openstackclient/identity/v3/trust.py +++ b/openstackclient/identity/v3/trust.py @@ -233,7 +233,7 @@ class DeleteTrust(command.Command): if errors > 0: total = len(parsed_args.trust) - msg = _("%(errors)s of %(total)s trusts failed " "to delete.") % { + msg = _("%(errors)s of %(total)s trusts failed to delete.") % { 'errors': errors, 'total': total, } diff --git a/openstackclient/identity/v3/user.py b/openstackclient/identity/v3/user.py index 545b1cda77..f31d067517 100644 --- a/openstackclient/identity/v3/user.py +++ b/openstackclient/identity/v3/user.py @@ -377,7 +377,7 @@ class DeleteUser(command.Command): if errors > 0: total = len(parsed_args.users) - msg = _("%(errors)s of %(total)s users failed " "to delete.") % { + msg = _("%(errors)s of %(total)s users failed to delete.") % { 'errors': errors, 'total': total, } diff --git a/openstackclient/image/v1/image.py b/openstackclient/image/v1/image.py index ecbb2050bb..2391c1639b 100644 --- a/openstackclient/image/v1/image.py +++ b/openstackclient/image/v1/image.py @@ -384,8 +384,7 @@ class DeleteImage(command.Command): except Exception as e: result += 1 msg = _( - "Failed to delete image with name or " - "ID '%(image)s': %(e)s" + "Failed to delete image with name or ID '%(image)s': %(e)s" ) LOG.error(msg, {'image': image, 'e': e}) diff --git a/openstackclient/image/v2/cache.py b/openstackclient/image/v2/cache.py index c69b7b592f..33a2f4fade 100644 --- a/openstackclient/image/v2/cache.py +++ b/openstackclient/image/v2/cache.py @@ -131,8 +131,7 @@ class QueueCachedImage(command.Command): except Exception as e: failures += 1 msg = _( - "Failed to queue image with name or " - "ID '%(image)s': %(e)s" + "Failed to queue image with name or ID '%(image)s': %(e)s" ) LOG.error(msg, {'image': image, 'e': e}) @@ -171,8 +170,7 @@ class DeleteCachedImage(command.Command): except Exception as e: failures += 1 msg = _( - "Failed to delete image with name or " - "ID '%(image)s': %(e)s" + "Failed to delete image with name or ID '%(image)s': %(e)s" ) LOG.error(msg, {'image': image, 'e': e}) diff --git a/openstackclient/image/v2/image.py b/openstackclient/image/v2/image.py index fe237e4e1a..c57fa99480 100644 --- a/openstackclient/image/v2/image.py +++ b/openstackclient/image/v2/image.py @@ -359,8 +359,7 @@ class CreateImage(command.ShowOne): action="store_true", default=False, help=_( - "Show upload progress bar " - "(ignored if passing data via stdin)" + "Show upload progress bar (ignored if passing data via stdin)" ), ) parser.add_argument( @@ -401,8 +400,7 @@ class CreateImage(command.ShowOne): metavar="", action='append', help=_( - "Set a tag on this image " - "(repeat option to set multiple tags)" + "Set a tag on this image (repeat option to set multiple tags)" ), ) parser.add_argument( @@ -705,8 +703,7 @@ class DeleteImage(command.Command): except Exception as e: result += 1 msg = _( - "Failed to delete image with name or " - "ID '%(image)s': %(e)s" + "Failed to delete image with name or ID '%(image)s': %(e)s" ) LOG.error(msg, {'image': image, 'e': e}) @@ -1153,8 +1150,7 @@ class SetImage(command.Command): default=None, action='append', help=_( - "Set a tag on this image " - "(repeat option to set multiple tags)" + "Set a tag on this image (repeat option to set multiple tags)" ), ) parser.add_argument( @@ -1466,7 +1462,7 @@ class UnsetImage(command.Command): image_client.remove_tag(image.id, k) except Exception: LOG.error( - _("tag unset failed, '%s' is a " "nonexistent tag "), k + _("tag unset failed, '%s' is a nonexistent tag "), k ) tagret += 1 @@ -1519,7 +1515,7 @@ class UnsetImage(command.Command): raise exceptions.CommandError(msg) elif propret > 0: msg = _( - "Failed to unset %(propret)s of %(proptotal)s" " properties." + "Failed to unset %(propret)s of %(proptotal)s properties." ) % {'propret': propret, 'proptotal': proptotal} raise exceptions.CommandError(msg) @@ -1551,8 +1547,7 @@ class StageImage(command.Command): action='store_true', default=False, help=_( - 'Show upload progress bar ' - '(ignored if passing data via stdin)' + 'Show upload progress bar (ignored if passing data via stdin)' ), ) parser.add_argument( diff --git a/openstackclient/image/v2/metadef_namespaces.py b/openstackclient/image/v2/metadef_namespaces.py index 8294daa02e..f753286c44 100644 --- a/openstackclient/image/v2/metadef_namespaces.py +++ b/openstackclient/image/v2/metadef_namespaces.py @@ -169,9 +169,10 @@ class DeleteMetadefNamespace(command.Command): if result > 0: total = len(parsed_args.namespace) - msg = _( - "%(result)s of %(total)s namespace failed " "to delete." - ) % {'result': result, 'total': total} + msg = _("%(result)s of %(total)s namespace failed to delete.") % { + 'result': result, + 'total': total, + } raise exceptions.CommandError(msg) diff --git a/openstackclient/network/client.py b/openstackclient/network/client.py index 887be52cbe..1970ab7a85 100644 --- a/openstackclient/network/client.py +++ b/openstackclient/network/client.py @@ -50,9 +50,7 @@ def build_option_parser(parser): '--os-network-api-version', metavar='', default=utils.env('OS_NETWORK_API_VERSION'), - help=_( - "Network API version, default=%s " "(Env: OS_NETWORK_API_VERSION)" - ) + help=_("Network API version, default=%s (Env: OS_NETWORK_API_VERSION)") % DEFAULT_API_VERSION, ) return parser diff --git a/openstackclient/network/common.py b/openstackclient/network/common.py index 3d5237b1b1..c32c98cfb2 100644 --- a/openstackclient/network/common.py +++ b/openstackclient/network/common.py @@ -303,8 +303,7 @@ class NeutronCommandWithExtraArgs(command.Command): if not converter: raise exceptions.CommandError( _( - "Type {property_type} of property {name} " - "is not supported" + "Type {property_type} of property {name} is not supported" ).format( property_type=_property['type'], name=_property['name'] ) diff --git a/openstackclient/network/v2/address_group.py b/openstackclient/network/v2/address_group.py index fee3d143c7..893f4673ce 100644 --- a/openstackclient/network/v2/address_group.py +++ b/openstackclient/network/v2/address_group.py @@ -76,8 +76,7 @@ class CreateAddressGroup(command.ShowOne, common.NeutronCommandWithExtraArgs): action='append', default=[], help=_( - "IP address or CIDR " - "(repeat option to set multiple addresses)" + "IP address or CIDR (repeat option to set multiple addresses)" ), ) parser.add_argument( @@ -139,7 +138,7 @@ class DeleteAddressGroup(command.Command): if result > 0: total = len(parsed_args.address_group) msg = _( - "%(result)s of %(total)s address groups failed " "to delete." + "%(result)s of %(total)s address groups failed to delete." ) % {'result': result, 'total': total} raise exceptions.CommandError(msg) @@ -159,8 +158,7 @@ class ListAddressGroup(command.Lister): '--project', metavar="", help=_( - "List address groups according to their project " - "(name or ID)" + "List address groups according to their project (name or ID)" ), ) identity_common.add_project_domain_option_to_parser(parser) @@ -233,8 +231,7 @@ class SetAddressGroup(common.NeutronCommandWithExtraArgs): action='append', default=[], help=_( - "IP address or CIDR " - "(repeat option to set multiple addresses)" + "IP address or CIDR (repeat option to set multiple addresses)" ), ) return parser diff --git a/openstackclient/network/v2/address_scope.py b/openstackclient/network/v2/address_scope.py index f28215462f..a7f396b73f 100644 --- a/openstackclient/network/v2/address_scope.py +++ b/openstackclient/network/v2/address_scope.py @@ -144,7 +144,7 @@ class DeleteAddressScope(command.Command): if result > 0: total = len(parsed_args.address_scope) msg = _( - "%(result)s of %(total)s address scopes failed " "to delete." + "%(result)s of %(total)s address scopes failed to delete." ) % {'result': result, 'total': total} raise exceptions.CommandError(msg) @@ -176,8 +176,7 @@ class ListAddressScope(command.Lister): '--project', metavar="", help=_( - "List address scopes according to their project " - "(name or ID)" + "List address scopes according to their project (name or ID)" ), ) identity_common.add_project_domain_option_to_parser(parser) diff --git a/openstackclient/network/v2/floating_ip.py b/openstackclient/network/v2/floating_ip.py index 86e517ff0c..d190d14b18 100644 --- a/openstackclient/network/v2/floating_ip.py +++ b/openstackclient/network/v2/floating_ip.py @@ -123,7 +123,7 @@ class CreateFloatingIP( '--port', metavar='', help=self.enhance_help_neutron( - _("Port to be associated with the floating IP " "(name or ID)") + _("Port to be associated with the floating IP (name or ID)") ), ) parser.add_argument( @@ -268,10 +268,7 @@ class ListFloatingIP(common.NetworkAndComputeLister): '--floating-ip-address', metavar='', help=self.enhance_help_neutron( - _( - "List floating IP(s) according to given floating IP " - "address" - ) + _("List floating IP(s) according to given floating IP address") ), ) parser.add_argument( @@ -308,10 +305,7 @@ class ListFloatingIP(common.NetworkAndComputeLister): '--router', metavar='', help=self.enhance_help_neutron( - _( - "List floating IP(s) according to given router (name or " - "ID)" - ) + _("List floating IP(s) according to given router (name or ID)") ), ) _tag.add_tag_filtering_option_to_parser( @@ -458,8 +452,7 @@ class SetFloatingIP(common.NeutronCommandWithExtraArgs): metavar='', dest='fixed_ip_address', help=_( - "Fixed IP of the port " - "(required only if port has multiple IPs)" + "Fixed IP of the port (required only if port has multiple IPs)" ), ) parser.add_argument( diff --git a/openstackclient/network/v2/floating_ip_port_forwarding.py b/openstackclient/network/v2/floating_ip_port_forwarding.py index 9151f04983..115d2a8116 100644 --- a/openstackclient/network/v2/floating_ip_port_forwarding.py +++ b/openstackclient/network/v2/floating_ip_port_forwarding.py @@ -243,7 +243,7 @@ class DeleteFloatingIPPortForwarding(command.Command): if result > 0: total = len(parsed_args.port_forwarding_id) msg = _( - "%(result)s of %(total)s Port forwarding failed " "to delete." + "%(result)s of %(total)s Port forwarding failed to delete." ) % {'result': result, 'total': total} raise exceptions.CommandError(msg) diff --git a/openstackclient/network/v2/l3_conntrack_helper.py b/openstackclient/network/v2/l3_conntrack_helper.py index f200090b7f..073b91f7be 100644 --- a/openstackclient/network/v2/l3_conntrack_helper.py +++ b/openstackclient/network/v2/l3_conntrack_helper.py @@ -66,8 +66,7 @@ class CreateConntrackHelper(command.ShowOne): required=True, metavar='', help=_( - 'The network protocol for the netfilter conntrack target ' - 'rule' + 'The network protocol for the netfilter conntrack target rule' ), ) parser.add_argument( @@ -158,8 +157,7 @@ class ListConntrackHelper(command.Lister): '--protocol', metavar='', help=_( - 'The network protocol for the netfilter conntrack target ' - 'rule' + 'The network protocol for the netfilter conntrack target rule' ), ) parser.add_argument( @@ -226,8 +224,7 @@ class SetConntrackHelper(command.Command): '--protocol', metavar='', help=_( - 'The network protocol for the netfilter conntrack target ' - 'rule' + 'The network protocol for the netfilter conntrack target rule' ), ) parser.add_argument( diff --git a/openstackclient/network/v2/local_ip.py b/openstackclient/network/v2/local_ip.py index 0d92f2c111..cc317fa9e2 100644 --- a/openstackclient/network/v2/local_ip.py +++ b/openstackclient/network/v2/local_ip.py @@ -149,9 +149,10 @@ class DeleteLocalIP(command.Command): if result > 0: total = len(parsed_args.local_ip) - msg = _( - "%(result)s of %(total)s local IPs failed " "to delete." - ) % {'result': result, 'total': total} + msg = _("%(result)s of %(total)s local IPs failed to delete.") % { + 'result': result, + 'total': total, + } raise exceptions.CommandError(msg) @@ -201,31 +202,27 @@ class ListLocalIP(command.Lister): parser.add_argument( '--project', metavar="", - help=_( - "List Local IPs according to their project " "(name or ID)" - ), + help=_("List Local IPs according to their project (name or ID)"), ) parser.add_argument( '--network', metavar='', - help=_( - "List Local IP(s) according to " "given network (name or ID)" - ), + help=_("List Local IP(s) according to given network (name or ID)"), ) parser.add_argument( '--local-port', metavar='', - help=_("List Local IP(s) according to " "given port (name or ID)"), + help=_("List Local IP(s) according to given port (name or ID)"), ) parser.add_argument( '--local-ip-address', metavar='', - help=_("List Local IP(s) according to " "given Local IP Address"), + help=_("List Local IP(s) according to given Local IP Address"), ) parser.add_argument( '--ip-mode', metavar='', - help=_("List Local IP(s) according to " "given IP mode"), + help=_("List Local IP(s) according to given IP mode"), ) identity_common.add_project_domain_option_to_parser(parser) diff --git a/openstackclient/network/v2/local_ip_association.py b/openstackclient/network/v2/local_ip_association.py index 9f8325be40..816f04882d 100644 --- a/openstackclient/network/v2/local_ip_association.py +++ b/openstackclient/network/v2/local_ip_association.py @@ -44,7 +44,7 @@ class CreateLocalIPAssociation(command.ShowOne): 'local_ip', metavar='', help=_( - "Local IP that the port association belongs to " "(Name or ID)" + "Local IP that the port association belongs to (Name or ID)" ), ) parser.add_argument( @@ -90,7 +90,7 @@ class DeleteLocalIPAssociation(command.Command): 'local_ip', metavar="", help=_( - "Local IP that the port association belongs to " "(Name or ID)" + "Local IP that the port association belongs to (Name or ID)" ), ) parser.add_argument( @@ -151,7 +151,7 @@ class ListLocalIPAssociation(command.Lister): '--fixed-port', metavar='', help=_( - "Filter the list result by the ID or name of " "the fixed port" + "Filter the list result by the ID or name of the fixed port" ), ) parser.add_argument( diff --git a/openstackclient/network/v2/ndp_proxy.py b/openstackclient/network/v2/ndp_proxy.py index 4c1871172f..feda746eda 100644 --- a/openstackclient/network/v2/ndp_proxy.py +++ b/openstackclient/network/v2/ndp_proxy.py @@ -124,13 +124,13 @@ class DeleteNDPProxy(command.Command): except Exception as e: result += 1 LOG.error( - _("Failed to delete NDP proxy " "'%(ndp_proxy)s': %(e)s"), + _("Failed to delete NDP proxy '%(ndp_proxy)s': %(e)s"), {'ndp_proxy': ndp_proxy, 'e': e}, ) if result > 0: total = len(parsed_args.ndp_proxy) msg = _( - "%(result)s of %(total)s NDP proxies failed " "to delete." + "%(result)s of %(total)s NDP proxies failed to delete." ) % {'result': result, 'total': total} raise exceptions.CommandError(msg) diff --git a/openstackclient/network/v2/network.py b/openstackclient/network/v2/network.py index 7636de0c93..82e4ce69a3 100644 --- a/openstackclient/network/v2/network.py +++ b/openstackclient/network/v2/network.py @@ -355,17 +355,14 @@ class CreateNetwork( '--qinq-vlan', action='store_true', help=self.enhance_help_neutron( - _("Enable VLAN QinQ (S-Tag ethtype 0x8a88) " "for the network") + _("Enable VLAN QinQ (S-Tag ethtype 0x8a88) for the network") ), ) vlan_qinq_grp.add_argument( '--no-qinq-vlan', action='store_true', help=self.enhance_help_neutron( - _( - "Disable VLAN QinQ (S-Tag ethtype 0x8a88) " - "for the network" - ) + _("Disable VLAN QinQ (S-Tag ethtype 0x8a88) for the network") ), ) diff --git a/openstackclient/network/v2/network_agent.py b/openstackclient/network/v2/network_agent.py index 516b0f0482..1555cb6540 100644 --- a/openstackclient/network/v2/network_agent.py +++ b/openstackclient/network/v2/network_agent.py @@ -155,7 +155,7 @@ class DeleteNetworkAgent(command.Command): if result > 0: total = len(parsed_args.network_agent) msg = _( - "%(result)s of %(total)s network agents failed " "to delete." + "%(result)s of %(total)s network agents failed to delete." ) % {'result': result, 'total': total} raise exceptions.CommandError(msg) diff --git a/openstackclient/network/v2/network_flavor_profile.py b/openstackclient/network/v2/network_flavor_profile.py index d9a4b5d2e6..ab2ba6850c 100644 --- a/openstackclient/network/v2/network_flavor_profile.py +++ b/openstackclient/network/v2/network_flavor_profile.py @@ -146,7 +146,7 @@ class DeleteNetworkFlavorProfile(command.Command): if result > 0: total = len(parsed_args.flavor_profile) msg = _( - "%(result)s of %(total)s flavor_profiles failed " "to delete." + "%(result)s of %(total)s flavor_profiles failed to delete." ) % {"result": result, "total": total} raise exceptions.CommandError(msg) diff --git a/openstackclient/network/v2/network_meter.py b/openstackclient/network/v2/network_meter.py index 5a6a8f2f21..9cb687e15a 100644 --- a/openstackclient/network/v2/network_meter.py +++ b/openstackclient/network/v2/network_meter.py @@ -139,12 +139,12 @@ class DeleteMeter(command.Command): except Exception as e: result += 1 LOG.error( - _("Failed to delete meter with " "ID '%(meter)s': %(e)s"), + _("Failed to delete meter with ID '%(meter)s': %(e)s"), {"meter": meter, "e": e}, ) if result > 0: total = len(parsed_args.meter) - msg = _("%(result)s of %(total)s meters failed " "to delete.") % { + msg = _("%(result)s of %(total)s meters failed to delete.") % { "result": result, "total": total, } diff --git a/openstackclient/network/v2/network_meter_rule.py b/openstackclient/network/v2/network_meter_rule.py index ea1bea269c..a3765456c3 100644 --- a/openstackclient/network/v2/network_meter_rule.py +++ b/openstackclient/network/v2/network_meter_rule.py @@ -168,17 +168,14 @@ class DeleteMeterRule(command.Command): except Exception as e: result += 1 LOG.error( - _( - "Failed to delete meter rule with " - "ID '%(id)s': %(e)s" - ), + _("Failed to delete meter rule with ID '%(id)s': %(e)s"), {"id": id, "e": e}, ) if result > 0: total = len(parsed_args.meter_rule_id) msg = _( - "%(result)s of %(total)s meter rules failed " "to delete." + "%(result)s of %(total)s meter rules failed to delete." ) % {"result": result, "total": total} raise exceptions.CommandError(msg) diff --git a/openstackclient/network/v2/network_qos_policy.py b/openstackclient/network/v2/network_qos_policy.py index 5023ea9880..7f3076f322 100644 --- a/openstackclient/network/v2/network_qos_policy.py +++ b/openstackclient/network/v2/network_qos_policy.py @@ -174,7 +174,7 @@ class DeleteNetworkQosPolicy(command.Command): if result > 0: total = len(parsed_args.policy) msg = _( - "%(result)s of %(total)s QoS policies failed " "to delete." + "%(result)s of %(total)s QoS policies failed to delete." ) % {'result': result, 'total': total} raise exceptions.CommandError(msg) diff --git a/openstackclient/network/v2/network_rbac.py b/openstackclient/network/v2/network_rbac.py index e3e5aff19e..2b64885d22 100644 --- a/openstackclient/network/v2/network_rbac.py +++ b/openstackclient/network/v2/network_rbac.py @@ -212,7 +212,7 @@ class DeleteNetworkRBAC(command.Command): if result > 0: total = len(parsed_args.rbac_policy) msg = _( - "%(result)s of %(total)s RBAC policies failed " "to delete." + "%(result)s of %(total)s RBAC policies failed to delete." ) % {'result': result, 'total': total} raise exceptions.CommandError(msg) diff --git a/openstackclient/network/v2/network_segment.py b/openstackclient/network/v2/network_segment.py index 7409523152..4ec2a2724a 100644 --- a/openstackclient/network/v2/network_segment.py +++ b/openstackclient/network/v2/network_segment.py @@ -141,7 +141,7 @@ class DeleteNetworkSegment(command.Command): if result > 0: total = len(parsed_args.network_segment) msg = _( - "%(result)s of %(total)s network segments failed " "to delete." + "%(result)s of %(total)s network segments failed to delete." ) % {'result': result, 'total': total} raise exceptions.CommandError(msg) diff --git a/openstackclient/network/v2/network_segment_range.py b/openstackclient/network/v2/network_segment_range.py index aa0509969f..2ee2a2587b 100644 --- a/openstackclient/network/v2/network_segment_range.py +++ b/openstackclient/network/v2/network_segment_range.py @@ -105,8 +105,7 @@ class CreateNetworkSegmentRange( dest="private", action="store_true", help=_( - 'Network segment range is assigned specifically to the ' - 'project' + 'Network segment range is assigned specifically to the project' ), ) shared_group.add_argument( @@ -196,8 +195,7 @@ class CreateNetworkSegmentRange( and parsed_args.physical_network ): msg = _( - "--physical-network is only allowed with --network-type " - "vlan" + "--physical-network is only allowed with --network-type vlan" ) raise exceptions.CommandError(msg) @@ -323,7 +321,7 @@ class ListNetworkSegmentRange(command.Lister): '--unused', action='store_true', help=_( - 'List network segment ranges that have segments ' 'not in use' + 'List network segment ranges that have segments not in use' ), ) available_group = parser.add_mutually_exclusive_group() @@ -457,8 +455,7 @@ class SetNetworkSegmentRange(common.NeutronCommandWithExtraArgs): ) except Exception as e: msg = _( - 'Network segment range set not supported by ' - 'Network API: %(e)s' + 'Network segment range set not supported by Network API: %(e)s' ) % {'e': e} raise exceptions.CommandError(msg) diff --git a/openstackclient/network/v2/network_trunk.py b/openstackclient/network/v2/network_trunk.py index a2b0fbf1f8..047e3e9325 100644 --- a/openstackclient/network/v2/network_trunk.py +++ b/openstackclient/network/v2/network_trunk.py @@ -128,7 +128,7 @@ class DeleteNetworkTrunk(command.Command): ) if result > 0: total = len(parsed_args.trunk) - msg = _("%(result)s of %(total)s trunks failed " "to delete.") % { + msg = _("%(result)s of %(total)s trunks failed to delete.") % { 'result': result, 'total': total, } diff --git a/openstackclient/network/v2/port.py b/openstackclient/network/v2/port.py index 3579194bf7..43838cd6c8 100644 --- a/openstackclient/network/v2/port.py +++ b/openstackclient/network/v2/port.py @@ -368,8 +368,7 @@ def _add_updatable_args(parser, create=False): '--dns-name', metavar='', help=_( - "Set DNS name for this port " - "(requires DNS integration extension)" + "Set DNS name for this port (requires DNS integration extension)" ), ) numa_affinity_policy_group = parser.add_mutually_exclusive_group() @@ -753,7 +752,7 @@ class DeletePort(command.Command): if result > 0: total = len(parsed_args.port) - msg = _("%(result)s of %(total)s ports failed " "to delete.") % { + msg = _("%(result)s of %(total)s ports failed to delete.") % { 'result': result, 'total': total, } diff --git a/openstackclient/network/v2/router.py b/openstackclient/network/v2/router.py index 0deae3600d..ee30d87fc5 100644 --- a/openstackclient/network/v2/router.py +++ b/openstackclient/network/v2/router.py @@ -671,7 +671,7 @@ class DeleteRouter(command.Command): if result > 0: total = len(parsed_args.router) - msg = _("%(result)s of %(total)s routers failed " "to delete.") % { + msg = _("%(result)s of %(total)s routers failed to delete.") % { 'result': result, 'total': total, } @@ -951,7 +951,7 @@ class SetRouter(common.NeutronCommandWithExtraArgs): '--ha', action='store_true', help=_( - "Set the router as highly available " "(disabled router only)" + "Set the router as highly available (disabled router only)" ), ) routes_ha.add_argument( diff --git a/openstackclient/network/v2/security_group.py b/openstackclient/network/v2/security_group.py index 556eff2c0d..09c888068a 100644 --- a/openstackclient/network/v2/security_group.py +++ b/openstackclient/network/v2/security_group.py @@ -239,10 +239,7 @@ class ListSecurityGroup(common.NetworkAndComputeLister): '--project', metavar='', help=self.enhance_help_neutron( - _( - "List security groups according to the project (name or " - "ID)" - ) + _("List security groups according to the project (name or ID)") ), ) identity_common.add_project_domain_option_to_parser( diff --git a/openstackclient/network/v2/security_group_rule.py b/openstackclient/network/v2/security_group_rule.py index 80e5ff0859..f9f8a42870 100644 --- a/openstackclient/network/v2/security_group_rule.py +++ b/openstackclient/network/v2/security_group_rule.py @@ -608,7 +608,7 @@ class ShowSecurityGroupRule(common.NetworkAndComputeShowOne): if obj is None: msg = ( - _("Could not find security group rule " "with ID '%s'") + _("Could not find security group rule with ID '%s'") % parsed_args.rule ) raise exceptions.CommandError(msg) diff --git a/openstackclient/network/v2/subnet.py b/openstackclient/network/v2/subnet.py index 3d172adb18..5b2aed6883 100644 --- a/openstackclient/network/v2/subnet.py +++ b/openstackclient/network/v2/subnet.py @@ -400,7 +400,7 @@ class CreateSubnet(command.ShowOne, common.NeutronCommandWithExtraArgs): '--network-segment', metavar='', help=_( - "Network segment to associate with this subnet " "(name or ID)" + "Network segment to associate with this subnet (name or ID)" ), ) parser.add_argument( @@ -465,7 +465,7 @@ class DeleteSubnet(command.Command): if result > 0: total = len(parsed_args.subnet) - msg = _("%(result)s of %(total)s subnets failed " "to delete.") % { + msg = _("%(result)s of %(total)s subnets failed to delete.") % { 'result': result, 'total': total, } diff --git a/openstackclient/network/v2/subnet_pool.py b/openstackclient/network/v2/subnet_pool.py index 78505bf2dd..fca3bfa667 100644 --- a/openstackclient/network/v2/subnet_pool.py +++ b/openstackclient/network/v2/subnet_pool.py @@ -256,7 +256,7 @@ class DeleteSubnetPool(command.Command): if result > 0: total = len(parsed_args.subnet_pool) msg = _( - "%(result)s of %(total)s subnet pools failed " "to delete." + "%(result)s of %(total)s subnet pools failed to delete." ) % {'result': result, 'total': total} raise exceptions.CommandError(msg) @@ -290,7 +290,7 @@ class ListSubnetPool(command.Lister): '--default', action='store_true', help=_( - "List subnet pools used as the default external " "subnet pool" + "List subnet pools used as the default external subnet pool" ), ) default_group.add_argument( diff --git a/openstackclient/tests/functional/compute/v2/test_server.py b/openstackclient/tests/functional/compute/v2/test_server.py index 47b6d7c72d..6afa2c7c0e 100644 --- a/openstackclient/tests/functional/compute/v2/test_server.py +++ b/openstackclient/tests/functional/compute/v2/test_server.py @@ -156,7 +156,7 @@ class ServerTests(common.ComputeTestCase): server_name3 = cmd_output['name'] cmd_output = self.openstack( - 'server list ' '--changes-since ' + updated_at2, + 'server list --changes-since ' + updated_at2, parse_output=True, ) @@ -852,8 +852,7 @@ class ServerTests(common.ComputeTestCase): # it to the server at /dev/vdb and delete the volume when the # server is deleted. bdm_arg = ( - f'--block-device-mapping ' - f'vdb={self.image_name}:image:1:true ' + f'--block-device-mapping vdb={self.image_name}:image:1:true ' ) else: # get image ID diff --git a/openstackclient/tests/functional/compute/v2/test_server_event.py b/openstackclient/tests/functional/compute/v2/test_server_event.py index 790aec69d7..0457985a08 100644 --- a/openstackclient/tests/functional/compute/v2/test_server_event.py +++ b/openstackclient/tests/functional/compute/v2/test_server_event.py @@ -93,7 +93,7 @@ class ServerEventTests(common.ComputeTestCase): # And verify we can get the event list after it's deleted # Test 'server event list' for deleting cmd_output = self.openstack( - '--os-compute-api-version 2.21 ' 'server event list ' + server_id, + '--os-compute-api-version 2.21 server event list ' + server_id, parse_output=True, ) request_id = None diff --git a/openstackclient/tests/functional/identity/v2/test_user.py b/openstackclient/tests/functional/identity/v2/test_user.py index e0d2c956a7..c92fc87927 100644 --- a/openstackclient/tests/functional/identity/v2/test_user.py +++ b/openstackclient/tests/functional/identity/v2/test_user.py @@ -37,7 +37,7 @@ class UserTests(common.IdentityTests): new_username = data_utils.rand_name('NewTestUser') new_email = data_utils.rand_name() + '@example.com' raw_output = self.openstack( - 'user set ' '--email {email} ' '--name {new_name} ' '{id}'.format( + 'user set --email {email} --name {new_name} {id}'.format( email=new_email, new_name=new_username, id=user['id'] ) ) diff --git a/openstackclient/tests/functional/identity/v3/common.py b/openstackclient/tests/functional/identity/v3/common.py index ecabfd2568..9f21374ff5 100644 --- a/openstackclient/tests/functional/identity/v3/common.py +++ b/openstackclient/tests/functional/identity/v3/common.py @@ -187,8 +187,7 @@ class IdentityTests(base.TestCase): f'domain set --disable {cls.domain_name}' ) cls.openstack( - '--os-identity-api-version 3 ' - f'domain delete {cls.domain_name}' + f'--os-identity-api-version 3 domain delete {cls.domain_name}' ) finally: super().tearDownClass() @@ -270,9 +269,7 @@ class IdentityTests(base.TestCase): if add_clean_up: self.addCleanup( self.openstack, - 'group delete ' - f'--domain {self.domain_name} ' - f'{group_name}', + f'group delete --domain {self.domain_name} {group_name}', ) items = self.parse_show(raw_output) self.assert_show_fields(items, self.GROUP_FIELDS) @@ -305,9 +302,7 @@ class IdentityTests(base.TestCase): if add_clean_up: self.addCleanup( self.openstack, - 'project delete ' - f'--domain {self.domain_name} ' - f'{project_name}', + f'project delete --domain {self.domain_name} {project_name}', ) return project_name diff --git a/openstackclient/tests/functional/identity/v3/test_application_credential.py b/openstackclient/tests/functional/identity/v3/test_application_credential.py index 39c735b2bb..a9c2286d57 100644 --- a/openstackclient/tests/functional/identity/v3/test_application_credential.py +++ b/openstackclient/tests/functional/identity/v3/test_application_credential.py @@ -50,35 +50,35 @@ class ApplicationCredentialTests(common.IdentityTests): def _create_role_assignments(self): try: user = self.openstack( - 'configuration show -f value' ' -c auth.username' + 'configuration show -f value -c auth.username' ) except Exception: user = self.openstack( - 'configuration show -f value' ' -c auth.user_id' + 'configuration show -f value -c auth.user_id' ) try: user_domain = self.openstack( - 'configuration show -f value' ' -c auth.user_domain_name' + 'configuration show -f value -c auth.user_domain_name' ) except Exception: user_domain = self.openstack( - 'configuration show -f value' ' -c auth.user_domain_id' + 'configuration show -f value -c auth.user_domain_id' ) try: project = self.openstack( - 'configuration show -f value' ' -c auth.project_name' + 'configuration show -f value -c auth.project_name' ) except Exception: project = self.openstack( - 'configuration show -f value' ' -c auth.project_id' + 'configuration show -f value -c auth.project_id' ) try: project_domain = self.openstack( - 'configuration show -f value' ' -c auth.project_domain_name' + 'configuration show -f value -c auth.project_domain_name' ) except Exception: project_domain = self.openstack( - 'configuration show -f value' ' -c auth.project_domain_id' + 'configuration show -f value -c auth.project_domain_id' ) role1 = self._create_dummy_role() role2 = self._create_dummy_role() @@ -130,7 +130,7 @@ class ApplicationCredentialTests(common.IdentityTests): def test_application_credential_delete(self): name = data_utils.rand_name('name') self.openstack(f'application credential create {name}') - raw_output = self.openstack('application credential delete ' f'{name}') + raw_output = self.openstack(f'application credential delete {name}') self.assertEqual(0, len(raw_output)) def test_application_credential_list(self): @@ -147,6 +147,6 @@ class ApplicationCredentialTests(common.IdentityTests): self.openstack, f'application credential delete {name}', ) - raw_output = self.openstack('application credential show ' f'{name}') + raw_output = self.openstack(f'application credential show {name}') items = self.parse_show(raw_output) self.assert_show_fields(items, self.APPLICATION_CREDENTIAL_FIELDS) diff --git a/openstackclient/tests/functional/identity/v3/test_endpoint.py b/openstackclient/tests/functional/identity/v3/test_endpoint.py index cafab670a3..0441fcb6ec 100644 --- a/openstackclient/tests/functional/identity/v3/test_endpoint.py +++ b/openstackclient/tests/functional/identity/v3/test_endpoint.py @@ -45,7 +45,7 @@ class EndpointTests(common.IdentityTests): endpoint_id = self._create_dummy_endpoint(add_clean_up=False) project_id = self._create_dummy_project(add_clean_up=False) raw_output = self.openstack( - 'endpoint add project ' f'{endpoint_id} ' f'{project_id}' + f'endpoint add project {endpoint_id} {project_id}' ) self.assertEqual(0, len(raw_output)) raw_output = self.openstack(f'endpoint list --endpoint {endpoint_id}') @@ -89,11 +89,11 @@ class EndpointTests(common.IdentityTests): endpoint_id = self._create_dummy_endpoint(add_clean_up=False) project_id = self._create_dummy_project(add_clean_up=False) raw_output = self.openstack( - 'endpoint add project ' f'{endpoint_id} ' f'{project_id}' + f'endpoint add project {endpoint_id} {project_id}' ) self.assertEqual(0, len(raw_output)) raw_output = self.openstack( - 'endpoint remove project ' f'{endpoint_id} ' f'{project_id}' + f'endpoint remove project {endpoint_id} {project_id}' ) self.assertEqual(0, len(raw_output)) diff --git a/openstackclient/tests/functional/identity/v3/test_group.py b/openstackclient/tests/functional/identity/v3/test_group.py index 5fc1ed39c3..a2e41d813a 100644 --- a/openstackclient/tests/functional/identity/v3/test_group.py +++ b/openstackclient/tests/functional/identity/v3/test_group.py @@ -36,14 +36,14 @@ class GroupTests(common.IdentityTests): def test_group_delete(self): group_name = self._create_dummy_group(add_clean_up=False) raw_output = self.openstack( - 'group delete ' f'--domain {self.domain_name} ' f'{group_name}' + f'group delete --domain {self.domain_name} {group_name}' ) self.assertEqual(0, len(raw_output)) def test_group_show(self): group_name = self._create_dummy_group() raw_output = self.openstack( - 'group show ' f'--domain {self.domain_name} ' f'{group_name}' + f'group show --domain {self.domain_name} {group_name}' ) items = self.parse_show(raw_output) self.assert_show_fields(items, self.GROUP_FIELDS) @@ -59,7 +59,7 @@ class GroupTests(common.IdentityTests): ) self.assertEqual(0, len(raw_output)) raw_output = self.openstack( - 'group show ' f'--domain {self.domain_name} ' f'{new_group_name}' + f'group show --domain {self.domain_name} {new_group_name}' ) group = self.parse_show_as_object(raw_output) self.assertEqual(new_group_name, group['name']) diff --git a/openstackclient/tests/functional/identity/v3/test_limit.py b/openstackclient/tests/functional/identity/v3/test_limit.py index 79213308d2..8c0bbcd6a9 100644 --- a/openstackclient/tests/functional/identity/v3/test_limit.py +++ b/openstackclient/tests/functional/identity/v3/test_limit.py @@ -174,7 +174,7 @@ class LimitTestCase(common.IdentityTests): } raw_output = self.openstack( - 'limit set' ' --description {description}' ' {limit_id}'.format( + 'limit set --description {description} {limit_id}'.format( **params ), cloud=SYSTEM_CLOUD, @@ -188,9 +188,9 @@ class LimitTestCase(common.IdentityTests): params = {'resource_limit': 5, 'limit_id': limit_id} raw_output = self.openstack( - 'limit set' - ' --resource-limit {resource_limit}' - ' {limit_id}'.format(**params), + 'limit set --resource-limit {resource_limit} {limit_id}'.format( + **params + ), cloud=SYSTEM_CLOUD, ) items = self.parse_show(raw_output) diff --git a/openstackclient/tests/functional/identity/v3/test_project.py b/openstackclient/tests/functional/identity/v3/test_project.py index 9115c0e1af..7a66c18518 100644 --- a/openstackclient/tests/functional/identity/v3/test_project.py +++ b/openstackclient/tests/functional/identity/v3/test_project.py @@ -30,9 +30,7 @@ class ProjectTests(common.IdentityTests): ) self.addCleanup( self.openstack, - 'project delete ' - f'--domain {self.domain_name} ' - f'{project_name}', + f'project delete --domain {self.domain_name} {project_name}', ) items = self.parse_show(raw_output) show_fields = list(self.PROJECT_FIELDS) @@ -45,7 +43,7 @@ class ProjectTests(common.IdentityTests): def test_project_delete(self): project_name = self._create_dummy_project(add_clean_up=False) raw_output = self.openstack( - 'project delete ' f'--domain {self.domain_name} ' f'{project_name}' + f'project delete --domain {self.domain_name} {project_name}' ) self.assertEqual(0, len(raw_output)) @@ -77,9 +75,7 @@ class ProjectTests(common.IdentityTests): self.assertEqual(0, len(raw_output)) # check project details raw_output = self.openstack( - 'project show ' - f'--domain {self.domain_name} ' - f'{new_project_name}' + f'project show --domain {self.domain_name} {new_project_name}' ) items = self.parse_show(raw_output) fields = list(self.PROJECT_FIELDS) @@ -91,17 +87,12 @@ class ProjectTests(common.IdentityTests): self.assertEqual('v0', project['k0']) # reset project to make sure it will be cleaned up self.openstack( - 'project set ' - f'--name {project_name} ' - '--enable ' - f'{new_project_name}' + f'project set --name {project_name} --enable {new_project_name}' ) def test_project_show(self): raw_output = self.openstack( - 'project show ' - f'--domain {self.domain_name} ' - f'{self.project_name}' + f'project show --domain {self.domain_name} {self.project_name}' ) items = self.parse_show(raw_output) self.assert_show_fields(items, self.PROJECT_FIELDS) diff --git a/openstackclient/tests/functional/identity/v3/test_region.py b/openstackclient/tests/functional/identity/v3/test_region.py index 16133f8941..49471002ad 100644 --- a/openstackclient/tests/functional/identity/v3/test_region.py +++ b/openstackclient/tests/functional/identity/v3/test_region.py @@ -49,9 +49,7 @@ class RegionTests(common.IdentityTests): self.assertEqual(region_id, region['region']) # update parent-region raw_output = self.openstack( - 'region set ' - f'--parent-region {new_parent_region_id} ' - f'{region_id}' + f'region set --parent-region {new_parent_region_id} {region_id}' ) self.assertEqual(0, len(raw_output)) # check updated region details diff --git a/openstackclient/tests/functional/identity/v3/test_registered_limit.py b/openstackclient/tests/functional/identity/v3/test_registered_limit.py index f91b47fc4b..54ee7f4f8f 100644 --- a/openstackclient/tests/functional/identity/v3/test_registered_limit.py +++ b/openstackclient/tests/functional/identity/v3/test_registered_limit.py @@ -25,7 +25,7 @@ class RegisteredLimitTestCase(common.IdentityTests): def test_registered_limit_create_with_service_id(self): service_name = self._create_dummy_service() - raw_output = self.openstack('service show' f' {service_name}') + raw_output = self.openstack(f'service show {service_name}') service_items = self.parse_show(raw_output) service_id = self._extract_value_from_items('id', service_items) @@ -44,7 +44,7 @@ class RegisteredLimitTestCase(common.IdentityTests): registered_limit_id = self._extract_value_from_items('id', items) self.addCleanup( self.openstack, - 'registered limit delete' f' {registered_limit_id}', + f'registered limit delete {registered_limit_id}', cloud=SYSTEM_CLOUD, ) @@ -178,7 +178,7 @@ class RegisteredLimitTestCase(common.IdentityTests): add_clean_up=False ) raw_output = self.openstack( - 'registered limit delete' f' {registered_limit_id}', + f'registered limit delete {registered_limit_id}', cloud=SYSTEM_CLOUD, ) self.assertEqual(0, len(raw_output)) diff --git a/openstackclient/tests/functional/identity/v3/test_role.py b/openstackclient/tests/functional/identity/v3/test_role.py index f4c6832f25..3237c0bfb4 100644 --- a/openstackclient/tests/functional/identity/v3/test_role.py +++ b/openstackclient/tests/functional/identity/v3/test_role.py @@ -23,7 +23,7 @@ class RoleTests(common.IdentityTests): role_name = data_utils.rand_name('TestRole') description = data_utils.rand_name('description') raw_output = self.openstack( - 'role create ' f'--description {description} ' f'{role_name}' + f'role create --description {description} {role_name}' ) role = self.parse_show_as_object(raw_output) self.addCleanup(self.openstack, 'role delete {}'.format(role['id'])) diff --git a/openstackclient/tests/functional/identity/v3/test_role_assignment.py b/openstackclient/tests/functional/identity/v3/test_role_assignment.py index 6c53bc2778..76e33c286e 100644 --- a/openstackclient/tests/functional/identity/v3/test_role_assignment.py +++ b/openstackclient/tests/functional/identity/v3/test_role_assignment.py @@ -24,35 +24,25 @@ class RoleAssignmentTests(common.IdentityTests): username = self._create_dummy_user() system = 'all' raw_output = self.openstack( - 'role add ' - f'--user {username} ' - f'--system {system} ' - f'{role_name}' + f'role add --user {username} --system {system} {role_name}' ) self.addCleanup( self.openstack, - 'role remove ' - f'--user {username} ' - f'--system {system} ' - f'{role_name}', + f'role remove --user {username} --system {system} {role_name}', ) self.assertEqual(0, len(raw_output)) - raw_output = self.openstack( - 'role assignment list ' f'--user {username} ' - ) + raw_output = self.openstack(f'role assignment list --user {username} ') items = self.parse_listing(raw_output) self.assert_table_structure(items, self.ROLE_ASSIGNMENT_LIST_HEADERS) raw_output = self.openstack( - 'role assignment list ' f'--role {role_name} ' + f'role assignment list --role {role_name} ' ) items = self.parse_listing(raw_output) self.assert_table_structure(items, self.ROLE_ASSIGNMENT_LIST_HEADERS) - raw_output = self.openstack( - 'role assignment list ' f'--system {system} ' - ) + raw_output = self.openstack(f'role assignment list --system {system} ') items = self.parse_listing(raw_output) self.assert_table_structure(items, self.ROLE_ASSIGNMENT_LIST_HEADERS) @@ -61,22 +51,14 @@ class RoleAssignmentTests(common.IdentityTests): group = self._create_dummy_group() system = 'all' raw_output = self.openstack( - 'role add ' - f'--group {group} ' - f'--system {system} ' - f'{role_name}' + f'role add --group {group} --system {system} {role_name}' ) self.addCleanup( self.openstack, - 'role remove ' - f'--group {group} ' - f'--system {system} ' - f'{role_name}', + f'role remove --group {group} --system {system} {role_name}', ) self.assertEqual(0, len(raw_output)) - raw_output = self.openstack( - 'role assignment list ' f'--group {group} ' - ) + raw_output = self.openstack(f'role assignment list --group {group} ') items = self.parse_listing(raw_output) self.assert_table_structure(items, self.ROLE_ASSIGNMENT_LIST_HEADERS) @@ -98,7 +80,7 @@ class RoleAssignmentTests(common.IdentityTests): ) self.assertEqual(0, len(raw_output)) raw_output = self.openstack( - 'role assignment list ' f'--domain {self.domain_name} ' + f'role assignment list --domain {self.domain_name} ' ) items = self.parse_listing(raw_output) self.assert_table_structure(items, self.ROLE_ASSIGNMENT_LIST_HEADERS) @@ -121,23 +103,23 @@ class RoleAssignmentTests(common.IdentityTests): ) self.assertEqual(0, len(raw_output)) raw_output = self.openstack( - 'role assignment list ' f'--project {self.project_name} ' + f'role assignment list --project {self.project_name} ' ) items = self.parse_listing(raw_output) self.assert_table_structure(items, self.ROLE_ASSIGNMENT_LIST_HEADERS) def test_role_assignment_list_effective(self): - raw_output = self.openstack('role assignment list ' '--effective') + raw_output = self.openstack('role assignment list --effective') items = self.parse_listing(raw_output) self.assert_table_structure(items, self.ROLE_ASSIGNMENT_LIST_HEADERS) def test_role_assignment_list_auth_user(self): - raw_output = self.openstack('role assignment list ' '--auth-user') + raw_output = self.openstack('role assignment list --auth-user') items = self.parse_listing(raw_output) self.assert_table_structure(items, self.ROLE_ASSIGNMENT_LIST_HEADERS) def test_role_assignment_list_auth_project(self): - raw_output = self.openstack('role assignment list ' '--auth-project') + raw_output = self.openstack('role assignment list --auth-project') items = self.parse_listing(raw_output) self.assert_table_structure(items, self.ROLE_ASSIGNMENT_LIST_HEADERS) diff --git a/openstackclient/tests/functional/identity/v3/test_user.py b/openstackclient/tests/functional/identity/v3/test_user.py index c32524600c..dd56293e63 100644 --- a/openstackclient/tests/functional/identity/v3/test_user.py +++ b/openstackclient/tests/functional/identity/v3/test_user.py @@ -22,7 +22,7 @@ class UserTests(common.IdentityTests): def test_user_delete(self): username = self._create_dummy_user(add_clean_up=False) raw_output = self.openstack( - 'user delete ' f'--domain {self.domain_name} ' f'{username}' + f'user delete --domain {self.domain_name} {username}' ) self.assertEqual(0, len(raw_output)) @@ -34,19 +34,19 @@ class UserTests(common.IdentityTests): def test_user_set(self): username = self._create_dummy_user() raw_output = self.openstack( - 'user show ' f'--domain {self.domain_name} ' f'{username}' + f'user show --domain {self.domain_name} {username}' ) user = self.parse_show_as_object(raw_output) new_username = data_utils.rand_name('NewTestUser') new_email = data_utils.rand_name() + '@example.com' raw_output = self.openstack( - 'user set ' '--email {email} ' '--name {new_name} ' '{id}'.format( + 'user set --email {email} --name {new_name} {id}'.format( email=new_email, new_name=new_username, id=user['id'] ) ) self.assertEqual(0, len(raw_output)) raw_output = self.openstack( - 'user show ' f'--domain {self.domain_name} ' f'{new_username}' + f'user show --domain {self.domain_name} {new_username}' ) updated_user = self.parse_show_as_object(raw_output) self.assertEqual(user['id'], updated_user['id']) @@ -57,7 +57,7 @@ class UserTests(common.IdentityTests): project_name = self._create_dummy_project() # get original user details raw_output = self.openstack( - 'user show ' f'--domain {self.domain_name} ' f'{username}' + f'user show --domain {self.domain_name} {username}' ) user = self.parse_show_as_object(raw_output) # update user @@ -74,12 +74,12 @@ class UserTests(common.IdentityTests): self.assertEqual(0, len(raw_output)) # get updated user details raw_output = self.openstack( - 'user show ' f'--domain {self.domain_name} ' f'{username}' + f'user show --domain {self.domain_name} {username}' ) updated_user = self.parse_show_as_object(raw_output) # get project details raw_output = self.openstack( - 'project show ' f'--domain {self.domain_name} ' f'{project_name}' + f'project show --domain {self.domain_name} {project_name}' ) project = self.parse_show_as_object(raw_output) # check updated user details @@ -89,7 +89,7 @@ class UserTests(common.IdentityTests): def test_user_show(self): username = self._create_dummy_user() raw_output = self.openstack( - 'user show ' f'--domain {self.domain_name} ' f'{username}' + f'user show --domain {self.domain_name} {username}' ) items = self.parse_show(raw_output) self.assert_show_fields(items, self.USER_FIELDS) diff --git a/openstackclient/tests/functional/network/v2/test_l3_conntrack_helper.py b/openstackclient/tests/functional/network/v2/test_l3_conntrack_helper.py index 95ebb49cea..60ae6d5ffe 100644 --- a/openstackclient/tests/functional/network/v2/test_l3_conntrack_helper.py +++ b/openstackclient/tests/functional/network/v2/test_l3_conntrack_helper.py @@ -69,8 +69,7 @@ class L3ConntrackHelperTests(common.NetworkTests): ct_ids = " ".join([ct['id'] for ct in created_helpers]) raw_output = self.openstack( - f'--debug network l3 conntrack helper delete {router_id} ' - f'{ct_ids}' + f'--debug network l3 conntrack helper delete {router_id} {ct_ids}' ) self.assertOutput('', raw_output) diff --git a/openstackclient/tests/functional/network/v2/test_network_ndp_proxy.py b/openstackclient/tests/functional/network/v2/test_network_ndp_proxy.py index 11d121a3e8..120f53d28d 100644 --- a/openstackclient/tests/functional/network/v2/test_network_ndp_proxy.py +++ b/openstackclient/tests/functional/network/v2/test_network_ndp_proxy.py @@ -31,7 +31,7 @@ class L3NDPProxyTests(common.NetworkTests): self.created_ndp_proxies = [] json_output = self.openstack( - 'address scope create --ip-version 6 ' f'{self.ADDR_SCOPE_NAME}', + f'address scope create --ip-version 6 {self.ADDR_SCOPE_NAME}', parse_output=True, ) self.assertIsNotNone(json_output['id']) @@ -88,8 +88,7 @@ class L3NDPProxyTests(common.NetworkTests): self.assertIsNotNone(json_output['id']) self.INT_SUB_ID = json_output['id'] json_output = self.openstack( - f'port create --network {self.INT_NET_ID} ' - f'{self.INT_PORT_NAME}', + f'port create --network {self.INT_NET_ID} {self.INT_PORT_NAME}', parse_output=True, ) self.assertIsNotNone(json_output['id']) diff --git a/openstackclient/tests/functional/network/v2/test_network_trunk.py b/openstackclient/tests/functional/network/v2/test_network_trunk.py index 0232943b31..1621973596 100644 --- a/openstackclient/tests/functional/network/v2/test_network_trunk.py +++ b/openstackclient/tests/functional/network/v2/test_network_trunk.py @@ -80,7 +80,7 @@ class NetworkTrunkTests(common.NetworkTests): self.addCleanup(self.openstack, 'network trunk delete ' + trunk_name) self.assertEqual(trunk_name, json_output['name']) - self.openstack('network trunk set ' '--enable ' + trunk_name) + self.openstack('network trunk set --enable ' + trunk_name) json_output = json.loads( self.openstack('network trunk show -f json ' + trunk_name) diff --git a/openstackclient/tests/functional/network/v2/test_port.py b/openstackclient/tests/functional/network/v2/test_port.py index 4530395507..5e64681099 100644 --- a/openstackclient/tests/functional/network/v2/test_port.py +++ b/openstackclient/tests/functional/network/v2/test_port.py @@ -209,7 +209,7 @@ class PortTests(common.NetworkTagTests): def test_port_admin_set(self): """Test create, set (as admin), show, delete""" json_output = self.openstack( - 'port create ' f'--network {self.NETWORK_NAME} {self.NAME}', + f'port create --network {self.NETWORK_NAME} {self.NAME}', parse_output=True, ) id_ = json_output.get('id') @@ -257,7 +257,7 @@ class PortTests(common.NetworkTagTests): self.assertEqual([sg_id1], json_output.get('security_group_ids')) raw_output = self.openstack( - 'port set ' f'--security-group {sg_name2} {name}' + f'port set --security-group {sg_name2} {name}' ) self.assertOutput('', raw_output) @@ -296,17 +296,17 @@ class PortTests(common.NetworkTagTests): sport2 = uuid.uuid4().hex trunk = uuid.uuid4().hex json_output = self.openstack( - 'port create ' f'--network {self.NETWORK_NAME} {pport}', + f'port create --network {self.NETWORK_NAME} {pport}', parse_output=True, ) pport_id = json_output.get('id') json_output = self.openstack( - 'port create ' f'--network {self.NETWORK_NAME} {sport1}', + f'port create --network {self.NETWORK_NAME} {sport1}', parse_output=True, ) sport1_id = json_output.get('id') json_output = self.openstack( - 'port create ' f'--network {self.NETWORK_NAME} {sport2}', + f'port create --network {self.NETWORK_NAME} {sport2}', parse_output=True, ) sport2_id = json_output.get('id') diff --git a/openstackclient/tests/unit/common/test_command.py b/openstackclient/tests/unit/common/test_command.py index f31c711729..8233f8994b 100644 --- a/openstackclient/tests/unit/common/test_command.py +++ b/openstackclient/tests/unit/common/test_command.py @@ -31,7 +31,7 @@ class TestCommand(test_utils.TestCase): cmd = FakeCommand(mock.Mock(), mock.Mock()) self.assertTrue(hasattr(cmd, 'log')) self.assertEqual( - 'openstackclient.tests.unit.common.test_command.' 'FakeCommand', + 'openstackclient.tests.unit.common.test_command.FakeCommand', cmd.log.name, ) diff --git a/openstackclient/tests/unit/compute/v2/test_server.py b/openstackclient/tests/unit/compute/v2/test_server.py index 789daadf47..2fa3aa7e17 100644 --- a/openstackclient/tests/unit/compute/v2/test_server.py +++ b/openstackclient/tests/unit/compute/v2/test_server.py @@ -4967,7 +4967,7 @@ class TestServerList(_TestServerList): self.fail('CommandError should be raised.') except exceptions.CommandError as e: self.assertEqual( - 'Invalid changes-since value: Invalid time ' 'value', str(e) + 'Invalid changes-since value: Invalid time value', str(e) ) mock_parse_isotime.assert_called_once_with('Invalid time value') @@ -5454,7 +5454,7 @@ class TestServerListV273(_TestServerList): self.fail('CommandError should be raised.') except exceptions.CommandError as e: self.assertEqual( - 'Invalid changes-before value: Invalid time ' 'value', str(e) + 'Invalid changes-before value: Invalid time value', str(e) ) mock_parse_isotime.assert_called_once_with('Invalid time value') diff --git a/openstackclient/tests/unit/identity/v2_0/fakes.py b/openstackclient/tests/unit/identity/v2_0/fakes.py index e07b026265..c5089d48b5 100644 --- a/openstackclient/tests/unit/identity/v2_0/fakes.py +++ b/openstackclient/tests/unit/identity/v2_0/fakes.py @@ -228,7 +228,7 @@ class FakeExtension: extension_info = { 'name': 'name-' + uuid.uuid4().hex, 'namespace': ( - 'http://docs.openstack.org/identity/' 'api/ext/OS-KSCRUD/v1.0' + 'http://docs.openstack.org/identity/api/ext/OS-KSCRUD/v1.0' ), 'description': 'description-' + uuid.uuid4().hex, 'updated': '2013-07-07T12:00:0-00:00', diff --git a/openstackclient/tests/unit/identity/v3/test_access_rule.py b/openstackclient/tests/unit/identity/v3/test_access_rule.py index 068dbb5d8a..0fc68dd366 100644 --- a/openstackclient/tests/unit/identity/v3/test_access_rule.py +++ b/openstackclient/tests/unit/identity/v3/test_access_rule.py @@ -77,9 +77,7 @@ class TestAccessRuleDelete(identity_fakes.TestIdentityv3): self.cmd.take_action(parsed_args) self.fail('CommandError should be raised.') except exceptions.CommandError as e: - self.assertEqual( - '1 of 2 access rules failed to' ' delete.', str(e) - ) + self.assertEqual('1 of 2 access rules failed to delete.', str(e)) calls = [] for a in arglist: diff --git a/openstackclient/tests/unit/identity/v3/test_application_credential.py b/openstackclient/tests/unit/identity/v3/test_application_credential.py index 94631d95a1..b53042ed1c 100644 --- a/openstackclient/tests/unit/identity/v3/test_application_credential.py +++ b/openstackclient/tests/unit/identity/v3/test_application_credential.py @@ -295,7 +295,7 @@ class TestApplicationCredentialDelete(identity_fakes.TestIdentityv3): self.fail('CommandError should be raised.') except exceptions.CommandError as e: self.assertEqual( - '1 of 2 application credentials failed to' ' delete.', str(e) + '1 of 2 application credentials failed to delete.', str(e) ) calls = [] diff --git a/openstackclient/tests/unit/identity/v3/test_mappings.py b/openstackclient/tests/unit/identity/v3/test_mappings.py index 60a89dd618..5a3fad97a8 100644 --- a/openstackclient/tests/unit/identity/v3/test_mappings.py +++ b/openstackclient/tests/unit/identity/v3/test_mappings.py @@ -55,7 +55,7 @@ class TestMappingCreate(TestMapping): mocker = mock.Mock() mocker.return_value = identity_fakes.MAPPING_RULES with mock.patch( - "openstackclient.identity.v3.mapping." "CreateMapping._read_rules", + "openstackclient.identity.v3.mapping.CreateMapping._read_rules", mocker, ): columns, data = self.cmd.take_action(parsed_args) @@ -170,7 +170,7 @@ class TestMappingSet(TestMapping): mocker = mock.Mock() mocker.return_value = identity_fakes.MAPPING_RULES_2 with mock.patch( - "openstackclient.identity.v3.mapping." "SetMapping._read_rules", + "openstackclient.identity.v3.mapping.SetMapping._read_rules", mocker, ): result = self.cmd.take_action(parsed_args) diff --git a/openstackclient/tests/unit/integ/cli/test_shell.py b/openstackclient/tests/unit/integ/cli/test_shell.py index 0a3a8ad430..6ac17be5f2 100644 --- a/openstackclient/tests/unit/integ/cli/test_shell.py +++ b/openstackclient/tests/unit/integ/cli/test_shell.py @@ -361,8 +361,7 @@ class TestIntegShellCliPrecedence(test_base.TestInteg): _shell = shell.OpenStackShell() _shell.run( - "--os-username zarquon --os-password qaz " - "extension list".split(), + "--os-username zarquon --os-password qaz extension list".split(), ) # Check general calls diff --git a/openstackclient/tests/unit/network/v2/test_network_trunk.py b/openstackclient/tests/unit/network/v2/test_network_trunk.py index 064c44f371..180e80de50 100644 --- a/openstackclient/tests/unit/network/v2/test_network_trunk.py +++ b/openstackclient/tests/unit/network/v2/test_network_trunk.py @@ -263,7 +263,7 @@ class TestCreateNetworkTrunk(TestNetworkTrunk): '--parent-port', self.new_trunk.port_id, '--subport', - 'segmentation-type={seg_type},' 'segmentation-id={seg_id}'.format( + 'segmentation-type={seg_type},segmentation-id={seg_id}'.format( seg_id=subport['segmentation_id'], seg_type=subport['segmentation_type'], ), @@ -727,7 +727,7 @@ class TestSetNetworkTrunk(TestNetworkTrunk): subport = self._trunk['sub_ports'][0] arglist = [ '--subport', - 'segmentation-type={seg_type},' 'segmentation-id={seg_id}'.format( + 'segmentation-type={seg_type},segmentation-id={seg_id}'.format( seg_id=subport['segmentation_id'], seg_type=subport['segmentation_type'], ), diff --git a/openstackclient/tests/unit/network/v2/test_port.py b/openstackclient/tests/unit/network/v2/test_port.py index 3f521a42ed..7f5271d109 100644 --- a/openstackclient/tests/unit/network/v2/test_port.py +++ b/openstackclient/tests/unit/network/v2/test_port.py @@ -807,8 +807,7 @@ class TestCreatePort(TestPort): extra_dhcp_options = [ { 'opt_name': 'classless-static-route', - 'opt_value': '169.254.169.254/32,22.2.0.2,' - '0.0.0.0/0,22.2.0.1', + 'opt_value': '169.254.169.254/32,22.2.0.2,0.0.0.0/0,22.2.0.1', 'ip_version': '4', }, { @@ -826,7 +825,7 @@ class TestCreatePort(TestPort): '0.0.0.0/0,22.2.0.1,' 'ip-version=4', '--extra-dhcp-option', - 'name=dns-server,value=240C::6666,' 'ip-version=6', + 'name=dns-server,value=240C::6666,ip-version=6', 'test-port', ] diff --git a/openstackclient/tests/unit/object/v1/test_object_all.py b/openstackclient/tests/unit/object/v1/test_object_all.py index 484ac1b910..968667b68e 100644 --- a/openstackclient/tests/unit/object/v1/test_object_all.py +++ b/openstackclient/tests/unit/object/v1/test_object_all.py @@ -252,9 +252,10 @@ class TestObjectSave(TestObjectAll): def __exit__(self, *a): self.context_manager_calls.append('__exit__') - with mock.patch('sys.stdout') as fake_stdout, mock.patch( - 'os.fdopen', return_value=FakeStdout() - ) as fake_fdopen: + with ( + mock.patch('sys.stdout') as fake_stdout, + mock.patch('os.fdopen', return_value=FakeStdout()) as fake_fdopen, + ): fake_stdout.fileno.return_value = 123 self.cmd.take_action(parsed_args) diff --git a/openstackclient/tests/unit/volume/v1/test_transfer_request.py b/openstackclient/tests/unit/volume/v1/test_transfer_request.py index e73a4c3ba4..47d925d4c4 100644 --- a/openstackclient/tests/unit/volume/v1/test_transfer_request.py +++ b/openstackclient/tests/unit/volume/v1/test_transfer_request.py @@ -239,7 +239,7 @@ class TestTransferDelete(TestTransfer): self.fail('CommandError should be raised.') except exceptions.CommandError as e: self.assertEqual( - '1 of 2 volume transfer requests failed ' 'to delete', + '1 of 2 volume transfer requests failed to delete', str(e), ) diff --git a/openstackclient/tests/unit/volume/v1/test_type.py b/openstackclient/tests/unit/volume/v1/test_type.py index daa495995c..bc15bcc4d3 100644 --- a/openstackclient/tests/unit/volume/v1/test_type.py +++ b/openstackclient/tests/unit/volume/v1/test_type.py @@ -431,7 +431,7 @@ class TestTypeSet(TestType): self.fail('CommandError should be raised.') except exceptions.CommandError as e: self.assertEqual( - "Command Failed: One or more of" " the operations failed", + "Command Failed: One or more of the operations failed", str(e), ) self.encryption_types_mock.create.assert_not_called() diff --git a/openstackclient/tests/unit/volume/v2/test_volume.py b/openstackclient/tests/unit/volume/v2/test_volume.py index 1667f38cd6..b293ee57da 100644 --- a/openstackclient/tests/unit/volume/v2/test_volume.py +++ b/openstackclient/tests/unit/volume/v2/test_volume.py @@ -1619,7 +1619,7 @@ class TestVolumeSet(TestVolume): result = self.cmd.take_action(parsed_args) self.volumes_mock.retype.assert_not_called() mock_warning.assert_called_with( - "'--retype-policy' option will " "not work without '--type' option" + "'--retype-policy' option will not work without '--type' option" ) self.assertIsNone(result) diff --git a/openstackclient/tests/unit/volume/v2/test_volume_transfer_request.py b/openstackclient/tests/unit/volume/v2/test_volume_transfer_request.py index 1885a1f5e0..2677ddc10a 100644 --- a/openstackclient/tests/unit/volume/v2/test_volume_transfer_request.py +++ b/openstackclient/tests/unit/volume/v2/test_volume_transfer_request.py @@ -241,7 +241,7 @@ class TestTransferDelete(TestTransfer): self.fail('CommandError should be raised.') except exceptions.CommandError as e: self.assertEqual( - '1 of 2 volume transfer requests failed ' 'to delete', + '1 of 2 volume transfer requests failed to delete', str(e), ) diff --git a/openstackclient/tests/unit/volume/v3/test_volume.py b/openstackclient/tests/unit/volume/v3/test_volume.py index 076de3ac3b..e3dc016656 100644 --- a/openstackclient/tests/unit/volume/v3/test_volume.py +++ b/openstackclient/tests/unit/volume/v3/test_volume.py @@ -2027,7 +2027,7 @@ class TestVolumeSet(volume_fakes.TestVolume): result = self.cmd.take_action(parsed_args) self.volumes_mock.retype.assert_not_called() mock_warning.assert_called_with( - "'--retype-policy' option will " "not work without '--type' option" + "'--retype-policy' option will not work without '--type' option" ) self.assertIsNone(result) diff --git a/openstackclient/tests/unit/volume/v3/test_volume_snapshot.py b/openstackclient/tests/unit/volume/v3/test_volume_snapshot.py index e07679fa83..4c990d840a 100644 --- a/openstackclient/tests/unit/volume/v3/test_volume_snapshot.py +++ b/openstackclient/tests/unit/volume/v3/test_volume_snapshot.py @@ -140,8 +140,7 @@ class TestVolumeSnapshotDelete(TestVolumeSnapshot): exceptions.CommandError, self.cmd.take_action, parsed_args ) self.assertIn( - "The --force option is not supported with the --remote " - "parameter.", + "The --force option is not supported with the --remote parameter.", str(exc), ) diff --git a/openstackclient/tests/unit/volume/v3/test_volume_transfer_request.py b/openstackclient/tests/unit/volume/v3/test_volume_transfer_request.py index 1871bde73d..ffe59db659 100644 --- a/openstackclient/tests/unit/volume/v3/test_volume_transfer_request.py +++ b/openstackclient/tests/unit/volume/v3/test_volume_transfer_request.py @@ -284,7 +284,7 @@ class TestTransferDelete(TestTransfer): self.fail('CommandError should be raised.') except exceptions.CommandError as e: self.assertEqual( - '1 of 2 volume transfer requests failed ' 'to delete', + '1 of 2 volume transfer requests failed to delete', str(e), ) diff --git a/openstackclient/volume/client.py b/openstackclient/volume/client.py index b07913086b..d3a3406a3c 100644 --- a/openstackclient/volume/client.py +++ b/openstackclient/volume/client.py @@ -105,9 +105,7 @@ def build_option_parser(parser): '--os-volume-api-version', metavar='', default=utils.env('OS_VOLUME_API_VERSION'), - help=_( - 'Volume API version, default=%s ' '(Env: OS_VOLUME_API_VERSION)' - ) + help=_('Volume API version, default=%s (Env: OS_VOLUME_API_VERSION)') % DEFAULT_API_VERSION, ) return parser diff --git a/openstackclient/volume/v1/qos_specs.py b/openstackclient/volume/v1/qos_specs.py index 74938392e4..93f7f48c64 100644 --- a/openstackclient/volume/v1/qos_specs.py +++ b/openstackclient/volume/v1/qos_specs.py @@ -152,8 +152,7 @@ class DeleteQos(command.Command): if result > 0: total = len(parsed_args.qos_specs) msg = _( - "%(result)s of %(total)s QoS specifications failed" - " to delete." + "%(result)s of %(total)s QoS specifications failed to delete." ) % {'result': result, 'total': total} raise exceptions.CommandError(msg) diff --git a/openstackclient/volume/v1/volume.py b/openstackclient/volume/v1/volume.py index 3ec995961c..78619320f7 100644 --- a/openstackclient/volume/v1/volume.py +++ b/openstackclient/volume/v1/volume.py @@ -242,8 +242,7 @@ class CreateVolume(command.ShowOne): ) else: msg = _( - "Volume status is not available for setting boot " - "state" + "Volume status is not available for setting boot state" ) raise exceptions.CommandError(msg) except Exception as e: @@ -268,10 +267,7 @@ class CreateVolume(command.ShowOne): raise exceptions.CommandError(msg) except Exception as e: LOG.error( - _( - "Failed to set volume read-only access " - "mode flag: %s" - ), + _("Failed to set volume read-only access mode flag: %s"), e, ) @@ -339,7 +335,7 @@ class DeleteVolume(command.Command): if result > 0: total = len(parsed_args.volumes) - msg = _("%(result)s of %(total)s volumes failed " "to delete.") % { + msg = _("%(result)s of %(total)s volumes failed to delete.") % { 'result': result, 'total': total, } @@ -628,10 +624,7 @@ class SetVolume(command.Command): ) except Exception as e: LOG.error( - _( - "Failed to set volume read-only access " - "mode flag: %s" - ), + _("Failed to set volume read-only access mode flag: %s"), e, ) result += 1 @@ -655,7 +648,7 @@ class SetVolume(command.Command): if result > 0: raise exceptions.CommandError( - _("One or more of the " "set operations failed") + _("One or more of the set operations failed") ) diff --git a/openstackclient/volume/v1/volume_backup.py b/openstackclient/volume/v1/volume_backup.py index 77aa81dc56..4819609d34 100644 --- a/openstackclient/volume/v1/volume_backup.py +++ b/openstackclient/volume/v1/volume_backup.py @@ -134,7 +134,7 @@ class DeleteVolumeBackup(command.Command): if result > 0: total = len(parsed_args.backups) - msg = _("%(result)s of %(total)s backups failed " "to delete.") % { + msg = _("%(result)s of %(total)s backups failed to delete.") % { 'result': result, 'total': total, } @@ -178,8 +178,7 @@ class ListVolumeBackup(command.Lister): "--volume", metavar="", help=_( - "Filters results by the volume which they " - "backup (name or ID)" + "Filters results by the volume which they backup (name or ID)" ), ) parser.add_argument( diff --git a/openstackclient/volume/v1/volume_snapshot.py b/openstackclient/volume/v1/volume_snapshot.py index 4953db1294..1d9fb86b15 100644 --- a/openstackclient/volume/v1/volume_snapshot.py +++ b/openstackclient/volume/v1/volume_snapshot.py @@ -73,8 +73,7 @@ class CreateVolumeSnapshot(command.ShowOne): '--volume', metavar='', help=_( - 'Volume to snapshot (name or ID) ' - '(default is )' + 'Volume to snapshot (name or ID) (default is )' ), ) parser.add_argument( @@ -88,8 +87,7 @@ class CreateVolumeSnapshot(command.ShowOne): action='store_true', default=False, help=_( - 'Create a snapshot attached to an instance. ' - 'Default is False' + 'Create a snapshot attached to an instance. Default is False' ), ) return parser @@ -153,9 +151,10 @@ class DeleteVolumeSnapshot(command.Command): if result > 0: total = len(parsed_args.snapshots) - msg = _( - "%(result)s of %(total)s snapshots failed " "to delete." - ) % {'result': result, 'total': total} + msg = _("%(result)s of %(total)s snapshots failed to delete.") % { + 'result': result, + 'total': total, + } raise exceptions.CommandError(msg) @@ -366,7 +365,7 @@ class SetVolumeSnapshot(command.Command): if result > 0: raise exceptions.CommandError( - _("One or more of the " "set operations failed") + _("One or more of the set operations failed") ) diff --git a/openstackclient/volume/v1/volume_type.py b/openstackclient/volume/v1/volume_type.py index fed0a601fa..5bd1cfdc95 100644 --- a/openstackclient/volume/v1/volume_type.py +++ b/openstackclient/volume/v1/volume_type.py @@ -224,7 +224,7 @@ class DeleteVolumeType(command.Command): if result > 0: total = len(parsed_args.volume_types) msg = _( - "%(result)s of %(total)s volume types failed " "to delete." + "%(result)s of %(total)s volume types failed to delete." ) % {'result': result, 'total': total} raise exceptions.CommandError(msg) @@ -403,7 +403,7 @@ class SetVolumeType(command.Command): if result > 0: raise exceptions.CommandError( - _("Command Failed: One or more of" " the operations failed") + _("Command Failed: One or more of the operations failed") ) @@ -481,8 +481,7 @@ class UnsetVolumeType(command.Command): "--encryption-type", action="store_true", help=_( - "Remove the encryption type for this volume type " - "(admin only)" + "Remove the encryption type for this volume type (admin only)" ), ) return parser @@ -516,5 +515,5 @@ class UnsetVolumeType(command.Command): if result > 0: raise exceptions.CommandError( - _("Command Failed: One or more of" " the operations failed") + _("Command Failed: One or more of the operations failed") ) diff --git a/openstackclient/volume/v2/consistency_group.py b/openstackclient/volume/v2/consistency_group.py index ee17acc53e..347724f925 100644 --- a/openstackclient/volume/v2/consistency_group.py +++ b/openstackclient/volume/v2/consistency_group.py @@ -38,10 +38,7 @@ def _find_volumes(parsed_args_volumes, volume_client): except Exception as e: result += 1 LOG.error( - _( - "Failed to find volume with " - "name or ID '%(volume)s':%(e)s" - ) + _("Failed to find volume with name or ID '%(volume)s':%(e)s") % {'volume': volume, 'e': e} ) @@ -76,7 +73,7 @@ class AddVolumeToConsistencyGroup(command.Command): if result > 0: total = len(parsed_args.volumes) LOG.error( - _("%(result)s of %(total)s volumes failed " "to add.") + _("%(result)s of %(total)s volumes failed to add.") % {'result': result, 'total': total} ) @@ -236,8 +233,7 @@ class DeleteConsistencyGroup(command.Command): if result > 0: total = len(parsed_args.consistency_groups) msg = _( - "%(result)s of %(total)s consistency groups failed " - "to delete." + "%(result)s of %(total)s consistency groups failed to delete." ) % {'result': result, 'total': total} raise exceptions.CommandError(msg) @@ -321,7 +317,7 @@ class RemoveVolumeFromConsistencyGroup(command.Command): if result > 0: total = len(parsed_args.volumes) LOG.error( - _("%(result)s of %(total)s volumes failed " "to remove.") + _("%(result)s of %(total)s volumes failed to remove.") % {'result': result, 'total': total} ) diff --git a/openstackclient/volume/v2/consistency_group_snapshot.py b/openstackclient/volume/v2/consistency_group_snapshot.py index 220d4f7f0b..3c582d6b1c 100644 --- a/openstackclient/volume/v2/consistency_group_snapshot.py +++ b/openstackclient/volume/v2/consistency_group_snapshot.py @@ -123,8 +123,7 @@ class ListConsistencyGroupSnapshot(command.Lister): '--all-projects', action="store_true", help=_( - 'Show detail for all projects (admin only) ' - '(defaults to False)' + 'Show detail for all projects (admin only) (defaults to False)' ), ) parser.add_argument( diff --git a/openstackclient/volume/v2/qos_specs.py b/openstackclient/volume/v2/qos_specs.py index fa6cec4949..72706a7409 100644 --- a/openstackclient/volume/v2/qos_specs.py +++ b/openstackclient/volume/v2/qos_specs.py @@ -153,8 +153,7 @@ class DeleteQos(command.Command): if result > 0: total = len(parsed_args.qos_specs) msg = _( - "%(result)s of %(total)s QoS specifications failed" - " to delete." + "%(result)s of %(total)s QoS specifications failed to delete." ) % {'result': result, 'total': total} raise exceptions.CommandError(msg) diff --git a/openstackclient/volume/v2/volume.py b/openstackclient/volume/v2/volume.py index 179da19601..8bbee4cb42 100644 --- a/openstackclient/volume/v2/volume.py +++ b/openstackclient/volume/v2/volume.py @@ -286,8 +286,7 @@ class CreateVolume(command.ShowOne): ) else: msg = _( - "Volume status is not available for setting boot " - "state" + "Volume status is not available for setting boot state" ) raise exceptions.CommandError(msg) except Exception as e: @@ -312,10 +311,7 @@ class CreateVolume(command.ShowOne): raise exceptions.CommandError(msg) except Exception as e: LOG.error( - _( - "Failed to set volume read-only access " - "mode flag: %s" - ), + _("Failed to set volume read-only access mode flag: %s"), e, ) @@ -356,8 +352,7 @@ class DeleteVolume(command.Command): "--purge", action="store_true", help=_( - "Remove any snapshots along with volume(s) " - "(defaults to False)" + "Remove any snapshots along with volume(s) (defaults to False)" ), ) return parser @@ -387,7 +382,7 @@ class DeleteVolume(command.Command): if result > 0: total = len(parsed_args.volumes) - msg = _("%(result)s of %(total)s volumes failed " "to delete.") % { + msg = _("%(result)s of %(total)s volumes failed to delete.") % { 'result': result, 'total': total, } @@ -829,10 +824,7 @@ class SetVolume(command.Command): ) except Exception as e: LOG.error( - _( - "Failed to set volume read-only access " - "mode flag: %s" - ), + _("Failed to set volume read-only access mode flag: %s"), e, ) result += 1 @@ -885,7 +877,7 @@ class SetVolume(command.Command): if result > 0: raise exceptions.CommandError( - _("One or more of the " "set operations failed") + _("One or more of the set operations failed") ) @@ -977,5 +969,5 @@ class UnsetVolume(command.Command): if result > 0: raise exceptions.CommandError( - _("One or more of the " "unset operations failed") + _("One or more of the unset operations failed") ) diff --git a/openstackclient/volume/v2/volume_backup.py b/openstackclient/volume/v2/volume_backup.py index 3c7b42eca6..5e0c75b6ef 100644 --- a/openstackclient/volume/v2/volume_backup.py +++ b/openstackclient/volume/v2/volume_backup.py @@ -345,8 +345,7 @@ class RestoreVolumeBackup(command.ShowOne): "--force", action="store_true", help=_( - "Restore the backup to an existing volume " - "(default to False)" + "Restore the backup to an existing volume (default to False)" ), ) return parser diff --git a/openstackclient/volume/v2/volume_snapshot.py b/openstackclient/volume/v2/volume_snapshot.py index 797fdc8537..e8d5484a27 100644 --- a/openstackclient/volume/v2/volume_snapshot.py +++ b/openstackclient/volume/v2/volume_snapshot.py @@ -74,8 +74,7 @@ class CreateVolumeSnapshot(command.ShowOne): "--volume", metavar="", help=_( - "Volume to snapshot (name or ID) " - "(default is )" + "Volume to snapshot (name or ID) (default is )" ), ) parser.add_argument( @@ -88,8 +87,7 @@ class CreateVolumeSnapshot(command.ShowOne): action="store_true", default=False, help=_( - "Create a snapshot attached to an instance. " - "Default is False" + "Create a snapshot attached to an instance. Default is False" ), ) parser.add_argument( @@ -200,9 +198,10 @@ class DeleteVolumeSnapshot(command.Command): if result > 0: total = len(parsed_args.snapshots) - msg = _( - "%(result)s of %(total)s snapshots failed " "to delete." - ) % {'result': result, 'total': total} + msg = _("%(result)s of %(total)s snapshots failed to delete.") % { + 'result': result, + 'total': total, + } raise exceptions.CommandError(msg) @@ -446,14 +445,14 @@ class SetVolumeSnapshot(command.Command): volume_client.volume_snapshots.update(snapshot.id, **kwargs) except Exception as e: LOG.error( - _("Failed to update snapshot name " "or description: %s"), + _("Failed to update snapshot name or description: %s"), e, ) result += 1 if result > 0: raise exceptions.CommandError( - _("One or more of the " "set operations failed") + _("One or more of the set operations failed") ) diff --git a/openstackclient/volume/v2/volume_type.py b/openstackclient/volume/v2/volume_type.py index be57f4b500..aaf0cb51f0 100644 --- a/openstackclient/volume/v2/volume_type.py +++ b/openstackclient/volume/v2/volume_type.py @@ -272,8 +272,7 @@ class CreateVolumeType(command.ShowOne): ) except Exception as e: msg = _( - "Failed to add project %(project)s access to " - "type: %(e)s" + "Failed to add project %(project)s access to type: %(e)s" ) LOG.error(msg % {'project': parsed_args.project, 'e': e}) @@ -363,7 +362,7 @@ class DeleteVolumeType(command.Command): if result > 0: total = len(parsed_args.volume_types) msg = _( - "%(result)s of %(total)s volume types failed " "to delete." + "%(result)s of %(total)s volume types failed to delete." ) % {'result': result, 'total': total} raise exceptions.CommandError(msg) @@ -553,8 +552,7 @@ class SetVolumeType(command.Command): '--project', metavar='', help=_( - 'Set volume type access to project (name or ID) ' - '(admin only)' + 'Set volume type access to project (name or ID) (admin only)' ), ) public_group = parser.add_mutually_exclusive_group() @@ -646,10 +644,7 @@ class SetVolumeType(command.Command): volume_client.volume_types.update(volume_type.id, **kwargs) except Exception as e: LOG.error( - _( - "Failed to update volume type name or" - " description: %s" - ), + _("Failed to update volume type name or description: %s"), e, ) result += 1 @@ -690,7 +685,7 @@ class SetVolumeType(command.Command): ) except Exception as e: LOG.error( - _("Failed to set volume type access to " "project: %s"), e + _("Failed to set volume type access to project: %s"), e ) result += 1 @@ -714,7 +709,7 @@ class SetVolumeType(command.Command): if result > 0: raise exceptions.CommandError( - _("Command Failed: One or more of" " the operations failed") + _("Command Failed: One or more of the operations failed") ) @@ -822,8 +817,7 @@ class UnsetVolumeType(command.Command): "--encryption-type", action="store_true", help=_( - "Remove the encryption type for this volume type " - "(admin only)" + "Remove the encryption type for this volume type (admin only)" ), ) return parser @@ -859,10 +853,7 @@ class UnsetVolumeType(command.Command): ) except Exception as e: LOG.error( - _( - "Failed to remove volume type access from " - "project: %s" - ), + _("Failed to remove volume type access from project: %s"), e, ) result += 1 @@ -881,5 +872,5 @@ class UnsetVolumeType(command.Command): if result > 0: raise exceptions.CommandError( - _("Command Failed: One or more of" " the operations failed") + _("Command Failed: One or more of the operations failed") ) diff --git a/openstackclient/volume/v3/block_storage_manage.py b/openstackclient/volume/v3/block_storage_manage.py index 5b76b53cb6..17c699b992 100644 --- a/openstackclient/volume/v3/block_storage_manage.py +++ b/openstackclient/volume/v3/block_storage_manage.py @@ -317,9 +317,7 @@ class BlockStorageManageSnapshots(command.Lister): # if the user requested e.g. '--detailed false' then they # should simply stop requesting this since the default has # changed - msg = _( - "The --detailed option has been deprecated. " "Unset it." - ) + msg = _("The --detailed option has been deprecated. Unset it.") self.log.warning(msg) columns = [ diff --git a/openstackclient/volume/v3/volume.py b/openstackclient/volume/v3/volume.py index 6f705ad6f9..e0c0339978 100644 --- a/openstackclient/volume/v3/volume.py +++ b/openstackclient/volume/v3/volume.py @@ -309,8 +309,7 @@ class CreateVolume(volume_v2.CreateVolume): ) else: msg = _( - "Volume status is not available for setting boot " - "state" + "Volume status is not available for setting boot state" ) raise exceptions.CommandError(msg) except Exception as e: @@ -335,10 +334,7 @@ class CreateVolume(volume_v2.CreateVolume): raise exceptions.CommandError(msg) except Exception as e: LOG.error( - _( - "Failed to set volume read-only access " - "mode flag: %s" - ), + _("Failed to set volume read-only access mode flag: %s"), e, ) @@ -402,7 +398,7 @@ class DeleteVolume(volume_v2.DeleteVolume): if result > 0: total = len(parsed_args.volumes) - msg = _("%(result)s of %(total)s volumes failed " "to delete.") % { + msg = _("%(result)s of %(total)s volumes failed to delete.") % { 'result': result, 'total': total, } @@ -847,10 +843,7 @@ class SetVolume(command.Command): ) except Exception as e: LOG.error( - _( - "Failed to set volume read-only access " - "mode flag: %s" - ), + _("Failed to set volume read-only access mode flag: %s"), e, ) result += 1 @@ -903,7 +896,7 @@ class SetVolume(command.Command): if result > 0: raise exceptions.CommandError( - _("One or more of the " "set operations failed") + _("One or more of the set operations failed") ) @@ -995,7 +988,7 @@ class UnsetVolume(command.Command): if result > 0: raise exceptions.CommandError( - _("One or more of the " "unset operations failed") + _("One or more of the unset operations failed") ) diff --git a/openstackclient/volume/v3/volume_backup.py b/openstackclient/volume/v3/volume_backup.py index dce5646a98..ce59115159 100644 --- a/openstackclient/volume/v3/volume_backup.py +++ b/openstackclient/volume/v3/volume_backup.py @@ -403,8 +403,7 @@ class RestoreVolumeBackup(command.ShowOne): "--force", action="store_true", help=_( - "Restore the backup to an existing volume " - "(default to False)" + "Restore the backup to an existing volume (default to False)" ), ) return parser diff --git a/openstackclient/volume/v3/volume_snapshot.py b/openstackclient/volume/v3/volume_snapshot.py index 1e528e8600..bb7f5a660e 100644 --- a/openstackclient/volume/v3/volume_snapshot.py +++ b/openstackclient/volume/v3/volume_snapshot.py @@ -91,7 +91,8 @@ class DeleteVolumeSnapshot(command.Command): if result > 0: total = len(parsed_args.snapshots) - msg = _( - "%(result)s of %(total)s snapshots failed " "to delete." - ) % {'result': result, 'total': total} + msg = _("%(result)s of %(total)s snapshots failed to delete.") % { + 'result': result, + 'total': total, + } raise exceptions.CommandError(msg) diff --git a/openstackclient/volume/v3/volume_type.py b/openstackclient/volume/v3/volume_type.py index 03c3fe2459..1cad79c0f2 100644 --- a/openstackclient/volume/v3/volume_type.py +++ b/openstackclient/volume/v3/volume_type.py @@ -273,8 +273,7 @@ class CreateVolumeType(command.ShowOne): ) except Exception as e: msg = _( - "Failed to add project %(project)s access to " - "type: %(e)s" + "Failed to add project %(project)s access to type: %(e)s" ) LOG.error(msg % {'project': parsed_args.project, 'e': e}) @@ -364,7 +363,7 @@ class DeleteVolumeType(command.Command): if result > 0: total = len(parsed_args.volume_types) msg = _( - "%(result)s of %(total)s volume types failed " "to delete." + "%(result)s of %(total)s volume types failed to delete." ) % {'result': result, 'total': total} raise exceptions.CommandError(msg) @@ -635,8 +634,7 @@ class SetVolumeType(command.Command): '--project', metavar='', help=_( - 'Set volume type access to project (name or ID) ' - '(admin only)' + 'Set volume type access to project (name or ID) (admin only)' ), ) public_group = parser.add_mutually_exclusive_group() @@ -728,10 +726,7 @@ class SetVolumeType(command.Command): volume_client.volume_types.update(volume_type.id, **kwargs) except Exception as e: LOG.error( - _( - "Failed to update volume type name or" - " description: %s" - ), + _("Failed to update volume type name or description: %s"), e, ) result += 1 @@ -772,7 +767,7 @@ class SetVolumeType(command.Command): ) except Exception as e: LOG.error( - _("Failed to set volume type access to " "project: %s"), e + _("Failed to set volume type access to project: %s"), e ) result += 1 @@ -796,7 +791,7 @@ class SetVolumeType(command.Command): if result > 0: raise exceptions.CommandError( - _("Command Failed: One or more of" " the operations failed") + _("Command Failed: One or more of the operations failed") ) @@ -904,8 +899,7 @@ class UnsetVolumeType(command.Command): "--encryption-type", action="store_true", help=_( - "Remove the encryption type for this volume type " - "(admin only)" + "Remove the encryption type for this volume type (admin only)" ), ) return parser @@ -941,10 +935,7 @@ class UnsetVolumeType(command.Command): ) except Exception as e: LOG.error( - _( - "Failed to remove volume type access from " - "project: %s" - ), + _("Failed to remove volume type access from project: %s"), e, ) result += 1 @@ -963,5 +954,5 @@ class UnsetVolumeType(command.Command): if result > 0: raise exceptions.CommandError( - _("Command Failed: One or more of" " the operations failed") + _("Command Failed: One or more of the operations failed") )