From d15bbada73f81136c966007d9c564dd6cfb2fd9c Mon Sep 17 00:00:00 2001 From: lihaijing Date: Fri, 7 Jul 2017 11:48:48 +0800 Subject: [PATCH] Replace six.iteritems() with .items() 1. As mentioned in [1], we should avoid using six.iteritems to achieve iterators. We can use dict.items instead, as it will return iterators in PY3 as well. And dict.items/keys will more readable. 2. In py2, the performance about list should be negligible, see the link [2]. [1] https://wiki.openstack.org/wiki/Python3 [2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html Co-Authored-By: Akihiro Motoki Change-Id: I4b9edb326444264c0f6c4ad281acaac356a07e85 Implements: blueprint replace-iteritems-with-items --- HACKING.rst | 3 +-- openstackclient/api/object_store_v1.py | 5 ++--- openstackclient/common/availability_zone.py | 5 ++--- openstackclient/common/configuration.py | 5 ++--- openstackclient/common/module.py | 3 +-- openstackclient/common/quota.py | 3 +-- openstackclient/compute/v2/agent.py | 3 +-- openstackclient/compute/v2/aggregate.py | 9 ++++----- openstackclient/compute/v2/console.py | 3 +-- openstackclient/compute/v2/flavor.py | 5 ++--- openstackclient/compute/v2/hypervisor.py | 3 +-- openstackclient/compute/v2/hypervisor_stats.py | 3 +-- openstackclient/compute/v2/keypair.py | 5 ++--- openstackclient/compute/v2/server.py | 6 +++--- openstackclient/compute/v2/server_backup.py | 3 +-- openstackclient/compute/v2/server_event.py | 3 +-- openstackclient/compute/v2/server_image.py | 3 +-- openstackclient/compute/v2/usage.py | 3 +-- openstackclient/identity/v2_0/catalog.py | 3 +-- openstackclient/identity/v2_0/ec2creds.py | 5 ++--- openstackclient/identity/v2_0/endpoint.py | 5 ++--- openstackclient/identity/v2_0/project.py | 5 ++--- openstackclient/identity/v2_0/role.py | 7 +++---- openstackclient/identity/v2_0/service.py | 9 ++++----- openstackclient/identity/v2_0/token.py | 3 +-- openstackclient/identity/v2_0/user.py | 5 ++--- openstackclient/identity/v3/application_credential.py | 5 ++--- openstackclient/identity/v3/catalog.py | 3 +-- openstackclient/identity/v3/consumer.py | 5 ++--- openstackclient/identity/v3/credential.py | 5 ++--- openstackclient/identity/v3/domain.py | 5 ++--- openstackclient/identity/v3/ec2creds.py | 5 ++--- openstackclient/identity/v3/endpoint.py | 5 ++--- openstackclient/identity/v3/endpoint_group.py | 5 ++--- openstackclient/identity/v3/federation_protocol.py | 7 +++---- openstackclient/identity/v3/group.py | 5 ++--- openstackclient/identity/v3/identity_provider.py | 5 ++--- openstackclient/identity/v3/implied_role.py | 3 +-- openstackclient/identity/v3/limit.py | 7 +++---- openstackclient/identity/v3/mapping.py | 5 ++--- openstackclient/identity/v3/policy.py | 5 ++--- openstackclient/identity/v3/project.py | 5 ++--- openstackclient/identity/v3/region.py | 5 ++--- openstackclient/identity/v3/registered_limit.py | 7 +++---- openstackclient/identity/v3/role.py | 5 ++--- openstackclient/identity/v3/service.py | 5 ++--- openstackclient/identity/v3/service_provider.py | 5 ++--- openstackclient/identity/v3/token.py | 9 ++++----- openstackclient/identity/v3/trust.py | 5 ++--- openstackclient/identity/v3/user.py | 5 ++--- openstackclient/image/v1/image.py | 5 ++--- openstackclient/image/v2/image.py | 10 +++++----- openstackclient/network/sdk_utils.py | 4 +--- openstackclient/network/v2/network_segment_range.py | 4 ++-- openstackclient/network/v2/security_group.py | 3 +-- openstackclient/network/v2/security_group_rule.py | 3 +-- openstackclient/object/v1/account.py | 3 +-- openstackclient/object/v1/container.py | 3 +-- openstackclient/object/v1/object.py | 3 +-- .../tests/unit/common/test_availability_zone.py | 6 ++---- openstackclient/tests/unit/fakes.py | 4 ++-- openstackclient/volume/v1/qos_specs.py | 5 ++--- openstackclient/volume/v1/volume.py | 5 ++--- openstackclient/volume/v1/volume_backup.py | 5 ++--- openstackclient/volume/v1/volume_snapshot.py | 5 ++--- openstackclient/volume/v1/volume_transfer_request.py | 7 +++---- openstackclient/volume/v1/volume_type.py | 5 ++--- openstackclient/volume/v2/backup_record.py | 5 ++--- openstackclient/volume/v2/consistency_group.py | 5 ++--- .../volume/v2/consistency_group_snapshot.py | 5 ++--- openstackclient/volume/v2/qos_specs.py | 5 ++--- openstackclient/volume/v2/volume.py | 5 ++--- openstackclient/volume/v2/volume_backup.py | 7 +++---- openstackclient/volume/v2/volume_snapshot.py | 5 ++--- openstackclient/volume/v2/volume_transfer_request.py | 7 +++---- openstackclient/volume/v2/volume_type.py | 5 ++--- 76 files changed, 148 insertions(+), 222 deletions(-) diff --git a/HACKING.rst b/HACKING.rst index 61803e9a4d..52e96caa93 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -93,8 +93,7 @@ OpenStackClient strives to be Python 3.3 compatible. Common guidelines: * Convert print statements to functions: print statements should be converted to an appropriate log or other output mechanism. -* Use six where applicable: x.iteritems is converted to six.iteritems(x) - for example. +* Prefer to x.items() over six.iteritems(x). Running Tests ------------- diff --git a/openstackclient/api/object_store_v1.py b/openstackclient/api/object_store_v1.py index d1e5dfaf45..44ff7a01fb 100644 --- a/openstackclient/api/object_store_v1.py +++ b/openstackclient/api/object_store_v1.py @@ -19,7 +19,6 @@ import os import sys from osc_lib import utils -import six from six.moves import urllib from openstackclient.api import api @@ -559,7 +558,7 @@ class APIv1(api.BaseAPI): log = logging.getLogger(__name__ + '._set_properties') headers = {} - for k, v in six.iteritems(properties): + for k, v in properties.items(): if not utils.is_ascii(k) or not utils.is_ascii(v): log.error('Cannot set property %s to non-ascii value', k) continue @@ -572,7 +571,7 @@ class APIv1(api.BaseAPI): # Add in properties as a top level key, this is consistent with other # OSC commands properties = {} - for k, v in six.iteritems(headers): + for k, v in headers.items(): if k.lower().startswith(header_tag): properties[k[len(header_tag):]] = v return properties diff --git a/openstackclient/common/availability_zone.py b/openstackclient/common/availability_zone.py index b2385ef743..3b2fa848a0 100644 --- a/openstackclient/common/availability_zone.py +++ b/openstackclient/common/availability_zone.py @@ -19,7 +19,6 @@ import logging from novaclient import exceptions as nova_exceptions from osc_lib.command import command from osc_lib import utils -import six from openstackclient.i18n import _ @@ -47,11 +46,11 @@ def _xform_compute_availability_zone(az, include_extra): return result if hasattr(az, 'hosts') and az.hosts: - for host, services in six.iteritems(az.hosts): + for host, services in az.hosts.items(): host_info = copy.deepcopy(zone_info) host_info['host_name'] = host - for svc, state in six.iteritems(services): + for svc, state in services.items(): info = copy.deepcopy(host_info) info['service_name'] = svc info['service_status'] = '%s %s %s' % ( diff --git a/openstackclient/common/configuration.py b/openstackclient/common/configuration.py index 53b30d5fdd..49ef0e05ca 100644 --- a/openstackclient/common/configuration.py +++ b/openstackclient/common/configuration.py @@ -15,7 +15,6 @@ from keystoneauth1.loading import base from osc_lib.command import command -import six from openstackclient.i18n import _ @@ -59,9 +58,9 @@ class ShowConfiguration(command.ShowOne): if o.secret ] - for key, value in six.iteritems(info.pop('auth', {})): + for key, value in info.pop('auth', {}).items(): if parsed_args.mask and key.lower() in secret_opts: value = REDACTED info['auth.' + key] = value - return zip(*sorted(six.iteritems(info))) + return zip(*sorted(info.items())) diff --git a/openstackclient/common/module.py b/openstackclient/common/module.py index 20497f2131..f55fdce048 100644 --- a/openstackclient/common/module.py +++ b/openstackclient/common/module.py @@ -19,7 +19,6 @@ import sys from osc_lib.command import command from osc_lib import utils -import six from openstackclient.i18n import _ @@ -113,4 +112,4 @@ class ListModule(command.ShowOne): # Catch all exceptions, just skip it pass - return zip(*sorted(six.iteritems(data))) + return zip(*sorted(data.items())) diff --git a/openstackclient/common/quota.py b/openstackclient/common/quota.py index 80c8749ac1..c7b3ad0707 100644 --- a/openstackclient/common/quota.py +++ b/openstackclient/common/quota.py @@ -21,7 +21,6 @@ import sys from osc_lib.command import command from osc_lib import utils -import six from openstackclient.i18n import _ from openstackclient.network import common @@ -663,4 +662,4 @@ class ShowQuota(command.ShowOne, BaseQuota): project_name = project_info['name'] info['project_name'] = project_name - return zip(*sorted(six.iteritems(info))) + return zip(*sorted(info.items())) diff --git a/openstackclient/compute/v2/agent.py b/openstackclient/compute/v2/agent.py index 151dcc1e82..3feb99ec83 100644 --- a/openstackclient/compute/v2/agent.py +++ b/openstackclient/compute/v2/agent.py @@ -20,7 +20,6 @@ import logging from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ @@ -77,7 +76,7 @@ class CreateAgent(command.ShowOne): parsed_args.hypervisor ) agent = compute_client.agents.create(*args)._info.copy() - return zip(*sorted(six.iteritems(agent))) + return zip(*sorted(agent.items())) class DeleteAgent(command.Command): diff --git a/openstackclient/compute/v2/aggregate.py b/openstackclient/compute/v2/aggregate.py index 3834de1f0b..599659a3e2 100644 --- a/openstackclient/compute/v2/aggregate.py +++ b/openstackclient/compute/v2/aggregate.py @@ -23,7 +23,6 @@ from osc_lib.cli import parseractions from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ @@ -68,7 +67,7 @@ class AddAggregateHost(command.ShowOne): 'properties': format_columns.DictColumn(info.pop('metadata')), }, ) - return zip(*sorted(six.iteritems(info))) + return zip(*sorted(info.items())) class CreateAggregate(command.ShowOne): @@ -125,7 +124,7 @@ class CreateAggregate(command.ShowOne): 'properties': properties, }, ) - return zip(*sorted(six.iteritems(info))) + return zip(*sorted(info.items())) class DeleteAggregate(command.Command): @@ -255,7 +254,7 @@ class RemoveAggregateHost(command.ShowOne): 'properties': format_columns.DictColumn(info.pop('metadata')), }, ) - return zip(*sorted(six.iteritems(info))) + return zip(*sorted(info.items())) class SetAggregate(command.Command): @@ -372,7 +371,7 @@ class ShowAggregate(command.ShowOne): info = {} info.update(data._info) - return zip(*sorted(six.iteritems(info))) + return zip(*sorted(info.items())) class UnsetAggregate(command.Command): diff --git a/openstackclient/compute/v2/console.py b/openstackclient/compute/v2/console.py index b2f7288f40..110b21b81e 100644 --- a/openstackclient/compute/v2/console.py +++ b/openstackclient/compute/v2/console.py @@ -18,7 +18,6 @@ from osc_lib.cli import parseractions from osc_lib.command import command from osc_lib import utils -import six from openstackclient.i18n import _ @@ -138,4 +137,4 @@ class ShowConsoleURL(command.ShowOne): # handle for different microversion API. console_data = data.get('remote_console', data.get('console')) info.update(console_data) - return zip(*sorted(six.iteritems(info))) + return zip(*sorted(info.items())) diff --git a/openstackclient/compute/v2/flavor.py b/openstackclient/compute/v2/flavor.py index 4f1e48af06..42649db504 100644 --- a/openstackclient/compute/v2/flavor.py +++ b/openstackclient/compute/v2/flavor.py @@ -22,7 +22,6 @@ from osc_lib.cli import parseractions from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ from openstackclient.identity import common as identity_common @@ -195,7 +194,7 @@ class CreateFlavor(command.ShowOne): flavor_info.pop("links") flavor_info['properties'] = utils.format_dict(flavor.get_keys()) - return zip(*sorted(six.iteritems(flavor_info))) + return zip(*sorted(flavor_info.items())) class DeleteFlavor(command.Command): @@ -447,7 +446,7 @@ class ShowFlavor(command.ShowOne): flavor['properties'] = utils.format_dict(resource_flavor.get_keys()) - return zip(*sorted(six.iteritems(flavor))) + return zip(*sorted(flavor.items())) class UnsetFlavor(command.Command): diff --git a/openstackclient/compute/v2/hypervisor.py b/openstackclient/compute/v2/hypervisor.py index 0d367fee86..7f110028b6 100644 --- a/openstackclient/compute/v2/hypervisor.py +++ b/openstackclient/compute/v2/hypervisor.py @@ -20,7 +20,6 @@ import re from novaclient import exceptions as nova_exceptions from osc_lib.command import command from osc_lib import utils -import six from openstackclient.i18n import _ @@ -126,4 +125,4 @@ class ShowHypervisor(command.ShowOne): hypervisor["service_host"] = hypervisor["service"]["host"] del hypervisor["service"] - return zip(*sorted(six.iteritems(hypervisor))) + return zip(*sorted(hypervisor.items())) diff --git a/openstackclient/compute/v2/hypervisor_stats.py b/openstackclient/compute/v2/hypervisor_stats.py index b0413005b6..4493e08018 100644 --- a/openstackclient/compute/v2/hypervisor_stats.py +++ b/openstackclient/compute/v2/hypervisor_stats.py @@ -15,7 +15,6 @@ """Hypervisor Stats action implementations""" from osc_lib.command import command -import six from openstackclient.i18n import _ @@ -27,4 +26,4 @@ class ShowHypervisorStats(command.ShowOne): compute_client = self.app.client_manager.compute hypervisor_stats = compute_client.hypervisors.statistics().to_dict() - return zip(*sorted(six.iteritems(hypervisor_stats))) + return zip(*sorted(hypervisor_stats.items())) diff --git a/openstackclient/compute/v2/keypair.py b/openstackclient/compute/v2/keypair.py index 851cced0e9..2b365cebff 100644 --- a/openstackclient/compute/v2/keypair.py +++ b/openstackclient/compute/v2/keypair.py @@ -23,7 +23,6 @@ import sys from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ @@ -101,7 +100,7 @@ class CreateKeypair(command.ShowOne): del info['public_key'] if 'private_key' in info: del info['private_key'] - return zip(*sorted(six.iteritems(info))) + return zip(*sorted(info.items())) else: sys.stdout.write(keypair.private_key) return ({}, {}) @@ -184,7 +183,7 @@ class ShowKeypair(command.ShowOne): info.update(keypair._info) if not parsed_args.public_key: del info['public_key'] - return zip(*sorted(six.iteritems(info))) + return zip(*sorted(info.items())) else: # NOTE(dtroyer): a way to get the public key in a similar form # as the private key in the create command diff --git a/openstackclient/compute/v2/server.py b/openstackclient/compute/v2/server.py index 84061a53c9..b5c420fe87 100644 --- a/openstackclient/compute/v2/server.py +++ b/openstackclient/compute/v2/server.py @@ -1069,7 +1069,7 @@ class CreateServer(command.ShowOne): raise SystemExit details = _prep_server_detail(compute_client, image_client, server) - return zip(*sorted(six.iteritems(details))) + return zip(*sorted(details.items())) class CreateServerDump(command.Command): @@ -1967,7 +1967,7 @@ class RebuildServer(command.ShowOne): details = _prep_server_detail(compute_client, image_client, server, refresh=False) - return zip(*sorted(six.iteritems(details))) + return zip(*sorted(details.items())) class RemoveFixedIP(command.Command): @@ -2537,7 +2537,7 @@ class ShowServer(command.ShowOne): self.app.client_manager.image, server, refresh=False) - return zip(*sorted(six.iteritems(data))) + return zip(*sorted(data.items())) class SshServer(command.Command): diff --git a/openstackclient/compute/v2/server_backup.py b/openstackclient/compute/v2/server_backup.py index a79f5f7039..1d560dc0c7 100644 --- a/openstackclient/compute/v2/server_backup.py +++ b/openstackclient/compute/v2/server_backup.py @@ -19,7 +19,6 @@ from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils from oslo_utils import importutils -import six from openstackclient.i18n import _ @@ -129,4 +128,4 @@ class CreateServerBackup(command.ShowOne): ] ) info = image_module._format_image(image) - return zip(*sorted(six.iteritems(info))) + return zip(*sorted(info.items())) diff --git a/openstackclient/compute/v2/server_event.py b/openstackclient/compute/v2/server_event.py index 6d33d02d50..4fcc913614 100644 --- a/openstackclient/compute/v2/server_event.py +++ b/openstackclient/compute/v2/server_event.py @@ -19,7 +19,6 @@ import logging from osc_lib.command import command from osc_lib import utils -import six from openstackclient.i18n import _ @@ -122,4 +121,4 @@ class ShowServerEvent(command.ShowOne): action_detail = compute_client.instance_action.get( server_id, parsed_args.request_id) - return zip(*sorted(six.iteritems(action_detail.to_dict()))) + return zip(*sorted(action_detail.to_dict().items())) diff --git a/openstackclient/compute/v2/server_image.py b/openstackclient/compute/v2/server_image.py index 3bc5d94aab..b93cd4d887 100644 --- a/openstackclient/compute/v2/server_image.py +++ b/openstackclient/compute/v2/server_image.py @@ -21,7 +21,6 @@ from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils from oslo_utils import importutils -import six from openstackclient.i18n import _ @@ -109,4 +108,4 @@ class CreateServerImage(command.ShowOne): ] ) info = image_module._format_image(image) - return zip(*sorted(six.iteritems(info))) + return zip(*sorted(info.items())) diff --git a/openstackclient/compute/v2/usage.py b/openstackclient/compute/v2/usage.py index f84cd61dfb..307c238afe 100644 --- a/openstackclient/compute/v2/usage.py +++ b/openstackclient/compute/v2/usage.py @@ -21,7 +21,6 @@ import datetime from novaclient import api_versions from osc_lib.command import command from osc_lib import utils -import six from openstackclient.i18n import _ @@ -236,4 +235,4 @@ class ShowUsage(command.ShowOne): info['Disk GB-Hours'] = ( float("%.2f" % usage.total_local_gb_usage) if hasattr(usage, "total_local_gb_usage") else None) - return zip(*sorted(six.iteritems(info))) + return zip(*sorted(info.items())) diff --git a/openstackclient/identity/v2_0/catalog.py b/openstackclient/identity/v2_0/catalog.py index 5d1e30626f..ccedbf3312 100644 --- a/openstackclient/identity/v2_0/catalog.py +++ b/openstackclient/identity/v2_0/catalog.py @@ -19,7 +19,6 @@ from cliff import columns as cliff_columns from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ @@ -102,4 +101,4 @@ class ShowCatalog(command.ShowOne): LOG.error(_('service %s not found\n'), parsed_args.service) return ((), ()) - return zip(*sorted(six.iteritems(data))) + return zip(*sorted(data.items())) diff --git a/openstackclient/identity/v2_0/ec2creds.py b/openstackclient/identity/v2_0/ec2creds.py index 0bc48322bc..f712bf4584 100644 --- a/openstackclient/identity/v2_0/ec2creds.py +++ b/openstackclient/identity/v2_0/ec2creds.py @@ -21,7 +21,6 @@ import logging from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ @@ -82,7 +81,7 @@ class CreateEC2Creds(command.ShowOne): {'project_id': info.pop('tenant_id')} ) - return zip(*sorted(six.iteritems(info))) + return zip(*sorted(info.items())) class DeleteEC2Creds(command.Command): @@ -206,4 +205,4 @@ class ShowEC2Creds(command.ShowOne): {'project_id': info.pop('tenant_id')} ) - return zip(*sorted(six.iteritems(info))) + return zip(*sorted(info.items())) diff --git a/openstackclient/identity/v2_0/endpoint.py b/openstackclient/identity/v2_0/endpoint.py index 1628e48813..57906ddff6 100644 --- a/openstackclient/identity/v2_0/endpoint.py +++ b/openstackclient/identity/v2_0/endpoint.py @@ -20,7 +20,6 @@ import logging from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ from openstackclient.identity import common @@ -76,7 +75,7 @@ class CreateEndpoint(command.ShowOne): info.update(endpoint._info) info['service_name'] = service.name info['service_type'] = service.type - return zip(*sorted(six.iteritems(info))) + return zip(*sorted(info.items())) class DeleteEndpoint(command.Command): @@ -178,4 +177,4 @@ class ShowEndpoint(command.ShowOne): info.update(match._info) info['service_name'] = service.name info['service_type'] = service.type - return zip(*sorted(six.iteritems(info))) + return zip(*sorted(info.items())) diff --git a/openstackclient/identity/v2_0/project.py b/openstackclient/identity/v2_0/project.py index e0018860e2..f431c02144 100644 --- a/openstackclient/identity/v2_0/project.py +++ b/openstackclient/identity/v2_0/project.py @@ -23,7 +23,6 @@ from osc_lib.cli import parseractions from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ @@ -100,7 +99,7 @@ class CreateProject(command.ShowOne): # TODO(stevemar): Remove the line below when we support multitenancy project._info.pop('parent_id', None) - return zip(*sorted(six.iteritems(project._info))) + return zip(*sorted(project._info.items())) class DeleteProject(command.Command): @@ -299,7 +298,7 @@ class ShowProject(command.ShowOne): properties[k] = v info['properties'] = format_columns.DictColumn(properties) - return zip(*sorted(six.iteritems(info))) + return zip(*sorted(info.items())) class UnsetProject(command.Command): diff --git a/openstackclient/identity/v2_0/role.py b/openstackclient/identity/v2_0/role.py index e9fe50fa4a..5c53fbcd5c 100644 --- a/openstackclient/identity/v2_0/role.py +++ b/openstackclient/identity/v2_0/role.py @@ -21,7 +21,6 @@ from keystoneauth1 import exceptions as ks_exc from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ @@ -69,7 +68,7 @@ class AddRole(command.ShowOne): info = {} info.update(role._info) - return zip(*sorted(six.iteritems(info))) + return zip(*sorted(info.items())) class CreateRole(command.ShowOne): @@ -105,7 +104,7 @@ class CreateRole(command.ShowOne): info = {} info.update(role._info) - return zip(*sorted(six.iteritems(info))) + return zip(*sorted(info.items())) class DeleteRole(command.Command): @@ -217,4 +216,4 @@ class ShowRole(command.ShowOne): info = {} info.update(role._info) - return zip(*sorted(six.iteritems(info))) + return zip(*sorted(info.items())) diff --git a/openstackclient/identity/v2_0/service.py b/openstackclient/identity/v2_0/service.py index 653de8eb47..afc0b3d7ad 100644 --- a/openstackclient/identity/v2_0/service.py +++ b/openstackclient/identity/v2_0/service.py @@ -20,7 +20,6 @@ import logging from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ from openstackclient.identity import common @@ -65,7 +64,7 @@ class CreateService(command.ShowOne): info = {} info.update(service._info) - return zip(*sorted(six.iteritems(info))) + return zip(*sorted(info.items())) class DeleteService(command.Command): @@ -153,11 +152,11 @@ class ShowService(command.ShowOne): if parsed_args.catalog: endpoints = auth_ref.service_catalog.get_endpoints( service_type=parsed_args.service) - for (service, service_endpoints) in six.iteritems(endpoints): + for (service, service_endpoints) in endpoints.items(): if service_endpoints: info = {"type": service} info.update(service_endpoints[0]) - return zip(*sorted(six.iteritems(info))) + return zip(*sorted(info.items())) msg = _("No service catalog with a type, name or ID of '%s' " "exists.") % (parsed_args.service) @@ -166,4 +165,4 @@ class ShowService(command.ShowOne): service = common.find_service(identity_client, parsed_args.service) info = {} info.update(service._info) - return zip(*sorted(six.iteritems(info))) + return zip(*sorted(info.items())) diff --git a/openstackclient/identity/v2_0/token.py b/openstackclient/identity/v2_0/token.py index 3b08b4750d..205e15d30b 100644 --- a/openstackclient/identity/v2_0/token.py +++ b/openstackclient/identity/v2_0/token.py @@ -17,7 +17,6 @@ from osc_lib.command import command from osc_lib import exceptions -import six from openstackclient.i18n import _ @@ -49,7 +48,7 @@ class IssueToken(command.ShowOne): data['project_id'] = auth_ref.project_id if auth_ref.user_id: data['user_id'] = auth_ref.user_id - return zip(*sorted(six.iteritems(data))) + return zip(*sorted(data.items())) class RevokeToken(command.Command): diff --git a/openstackclient/identity/v2_0/user.py b/openstackclient/identity/v2_0/user.py index 0675877b9b..8dac093ef4 100644 --- a/openstackclient/identity/v2_0/user.py +++ b/openstackclient/identity/v2_0/user.py @@ -23,7 +23,6 @@ from keystoneauth1 import exceptions as ks_exc from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ @@ -154,7 +153,7 @@ class CreateUser(command.ShowOne): info = {} info.update(user._info) - return zip(*sorted(six.iteritems(info))) + return zip(*sorted(info.items())) class DeleteUser(command.Command): @@ -418,4 +417,4 @@ class ShowUser(command.ShowOne): {'project_id': info.pop('tenant_id')} ) - return zip(*sorted(six.iteritems(info))) + return zip(*sorted(info.items())) diff --git a/openstackclient/identity/v3/application_credential.py b/openstackclient/identity/v3/application_credential.py index 747fa20ed1..ea0b30cdbb 100644 --- a/openstackclient/identity/v3/application_credential.py +++ b/openstackclient/identity/v3/application_credential.py @@ -21,7 +21,6 @@ import logging from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ from openstackclient.identity import common @@ -123,7 +122,7 @@ class CreateApplicationCredential(command.ShowOne): msg = ' '.join(r['name'] for r in roles) application_credential._info['roles'] = msg - return zip(*sorted(six.iteritems(application_credential._info))) + return zip(*sorted(application_credential._info.items())) class DeleteApplicationCredential(command.Command): @@ -217,4 +216,4 @@ class ShowApplicationCredential(command.ShowOne): msg = ' '.join(r['name'] for r in roles) app_cred._info['roles'] = msg - return zip(*sorted(six.iteritems(app_cred._info))) + return zip(*sorted(app_cred._info.items())) diff --git a/openstackclient/identity/v3/catalog.py b/openstackclient/identity/v3/catalog.py index 59430c4ce0..d1f7d31909 100644 --- a/openstackclient/identity/v3/catalog.py +++ b/openstackclient/identity/v3/catalog.py @@ -19,7 +19,6 @@ from cliff import columns as cliff_columns from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ @@ -97,4 +96,4 @@ class ShowCatalog(command.ShowOne): LOG.error(_('service %s not found\n'), parsed_args.service) return ((), ()) - return zip(*sorted(six.iteritems(data))) + return zip(*sorted(data.items())) diff --git a/openstackclient/identity/v3/consumer.py b/openstackclient/identity/v3/consumer.py index 6dd24dccf1..2f925aba87 100644 --- a/openstackclient/identity/v3/consumer.py +++ b/openstackclient/identity/v3/consumer.py @@ -20,7 +20,6 @@ import logging from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ @@ -46,7 +45,7 @@ class CreateConsumer(command.ShowOne): parsed_args.description ) consumer._info.pop('links', None) - return zip(*sorted(six.iteritems(consumer._info))) + return zip(*sorted(consumer._info.items())) class DeleteConsumer(command.Command): @@ -142,4 +141,4 @@ class ShowConsumer(command.ShowOne): identity_client.oauth1.consumers, parsed_args.consumer) consumer._info.pop('links', None) - return zip(*sorted(six.iteritems(consumer._info))) + return zip(*sorted(consumer._info.items())) diff --git a/openstackclient/identity/v3/credential.py b/openstackclient/identity/v3/credential.py index 981f940aae..bf48df83d5 100644 --- a/openstackclient/identity/v3/credential.py +++ b/openstackclient/identity/v3/credential.py @@ -20,7 +20,6 @@ import logging from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ from openstackclient.identity import common @@ -74,7 +73,7 @@ class CreateCredential(command.ShowOne): project=project) credential._info.pop('links') - return zip(*sorted(six.iteritems(credential._info))) + return zip(*sorted(credential._info.items())) class DeleteCredential(command.Command): @@ -225,4 +224,4 @@ class ShowCredential(command.ShowOne): parsed_args.credential) credential._info.pop('links') - return zip(*sorted(six.iteritems(credential._info))) + return zip(*sorted(credential._info.items())) diff --git a/openstackclient/identity/v3/domain.py b/openstackclient/identity/v3/domain.py index 064624ab45..dbcc97f6d2 100644 --- a/openstackclient/identity/v3/domain.py +++ b/openstackclient/identity/v3/domain.py @@ -21,7 +21,6 @@ from keystoneauth1 import exceptions as ks_exc from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ from openstackclient.identity import common @@ -85,7 +84,7 @@ class CreateDomain(command.ShowOne): raise domain._info.pop('links') - return zip(*sorted(six.iteritems(domain._info))) + return zip(*sorted(domain._info.items())) class DeleteDomain(command.Command): @@ -206,4 +205,4 @@ class ShowDomain(command.ShowOne): domain_str) domain._info.pop('links') - return zip(*sorted(six.iteritems(domain._info))) + return zip(*sorted(domain._info.items())) diff --git a/openstackclient/identity/v3/ec2creds.py b/openstackclient/identity/v3/ec2creds.py index 44e9a2c778..921b9168b0 100644 --- a/openstackclient/identity/v3/ec2creds.py +++ b/openstackclient/identity/v3/ec2creds.py @@ -17,7 +17,6 @@ import logging from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ from openstackclient.identity import common @@ -108,7 +107,7 @@ class CreateEC2Creds(command.ShowOne): {'project_id': info.pop('tenant_id')} ) - return zip(*sorted(six.iteritems(info))) + return zip(*sorted(info.items())) class DeleteEC2Creds(command.Command): @@ -209,4 +208,4 @@ class ShowEC2Creds(command.ShowOne): {'project_id': info.pop('tenant_id')} ) - return zip(*sorted(six.iteritems(info))) + return zip(*sorted(info.items())) diff --git a/openstackclient/identity/v3/endpoint.py b/openstackclient/identity/v3/endpoint.py index 858b50363b..a3bd2683ee 100644 --- a/openstackclient/identity/v3/endpoint.py +++ b/openstackclient/identity/v3/endpoint.py @@ -20,7 +20,6 @@ import logging from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ from openstackclient.identity import common @@ -131,7 +130,7 @@ class CreateEndpoint(command.ShowOne): info.update(endpoint._info) info['service_name'] = get_service_name(service) info['service_type'] = service.type - return zip(*sorted(six.iteritems(info))) + return zip(*sorted(info.items())) class DeleteEndpoint(command.Command): @@ -389,4 +388,4 @@ class ShowEndpoint(command.ShowOne): info.update(endpoint._info) info['service_name'] = get_service_name(service) info['service_type'] = service.type - return zip(*sorted(six.iteritems(info))) + return zip(*sorted(info.items())) diff --git a/openstackclient/identity/v3/endpoint_group.py b/openstackclient/identity/v3/endpoint_group.py index 66bd164d0d..cbe27edb4b 100644 --- a/openstackclient/identity/v3/endpoint_group.py +++ b/openstackclient/identity/v3/endpoint_group.py @@ -19,7 +19,6 @@ import logging from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ from openstackclient.identity import common @@ -129,7 +128,7 @@ class CreateEndpointGroup(command.ShowOne, _FiltersReader): info = {} endpoint_group._info.pop('links') info.update(endpoint_group._info) - return zip(*sorted(six.iteritems(info))) + return zip(*sorted(info.items())) class DeleteEndpointGroup(command.Command): @@ -321,4 +320,4 @@ class ShowEndpointGroup(command.ShowOne): info = {} endpoint_group._info.pop('links') info.update(endpoint_group._info) - return zip(*sorted(six.iteritems(info))) + return zip(*sorted(info.items())) diff --git a/openstackclient/identity/v3/federation_protocol.py b/openstackclient/identity/v3/federation_protocol.py index 6429d934c1..0929469e7e 100644 --- a/openstackclient/identity/v3/federation_protocol.py +++ b/openstackclient/identity/v3/federation_protocol.py @@ -19,7 +19,6 @@ import logging from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ @@ -68,7 +67,7 @@ class CreateProtocol(command.ShowOne): info['identity_provider'] = parsed_args.identity_provider info['mapping'] = info.pop('mapping_id') info.pop('links', None) - return zip(*sorted(six.iteritems(info))) + return zip(*sorted(info.items())) class DeleteProtocol(command.Command): @@ -175,7 +174,7 @@ class SetProtocol(command.Command): # user. info['identity_provider'] = parsed_args.identity_provider info['mapping'] = info.pop('mapping_id') - return zip(*sorted(six.iteritems(info))) + return zip(*sorted(info.items())) class ShowProtocol(command.ShowOne): @@ -205,4 +204,4 @@ class ShowProtocol(command.ShowOne): info = dict(protocol._info) info['mapping'] = info.pop('mapping_id') info.pop('links', None) - return zip(*sorted(six.iteritems(info))) + return zip(*sorted(info.items())) diff --git a/openstackclient/identity/v3/group.py b/openstackclient/identity/v3/group.py index 02eeadd63f..46c3142cdd 100644 --- a/openstackclient/identity/v3/group.py +++ b/openstackclient/identity/v3/group.py @@ -21,7 +21,6 @@ from keystoneauth1 import exceptions as ks_exc from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ from openstackclient.identity import common @@ -182,7 +181,7 @@ class CreateGroup(command.ShowOne): raise group._info.pop('links') - return zip(*sorted(six.iteritems(group._info))) + return zip(*sorted(group._info.items())) class DeleteGroup(command.Command): @@ -405,4 +404,4 @@ class ShowGroup(command.ShowOne): domain_name_or_id=parsed_args.domain) group._info.pop('links') - return zip(*sorted(six.iteritems(group._info))) + return zip(*sorted(group._info.items())) diff --git a/openstackclient/identity/v3/identity_provider.py b/openstackclient/identity/v3/identity_provider.py index b331518213..2b2d9d11bd 100644 --- a/openstackclient/identity/v3/identity_provider.py +++ b/openstackclient/identity/v3/identity_provider.py @@ -19,7 +19,6 @@ from osc_lib.cli import format_columns from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ from openstackclient.identity import common @@ -106,7 +105,7 @@ class CreateIdentityProvider(command.ShowOne): idp._info.pop('links', None) remote_ids = format_columns.ListColumn(idp._info.pop('remote_ids', [])) idp._info['remote_ids'] = remote_ids - return zip(*sorted(six.iteritems(idp._info))) + return zip(*sorted(idp._info.items())) class DeleteIdentityProvider(command.Command): @@ -248,4 +247,4 @@ class ShowIdentityProvider(command.ShowOne): idp._info.pop('links', None) remote_ids = format_columns.ListColumn(idp._info.pop('remote_ids', [])) idp._info['remote_ids'] = remote_ids - return zip(*sorted(six.iteritems(idp._info))) + return zip(*sorted(idp._info.items())) diff --git a/openstackclient/identity/v3/implied_role.py b/openstackclient/identity/v3/implied_role.py index 4e3df88ac1..054f30285c 100644 --- a/openstackclient/identity/v3/implied_role.py +++ b/openstackclient/identity/v3/implied_role.py @@ -18,7 +18,6 @@ import logging from osc_lib.command import command -import six from openstackclient.i18n import _ @@ -75,7 +74,7 @@ class CreateImpliedRole(command.ShowOne): prior_role_id, implied_role_id) response._info.pop('links', None) return zip(*sorted([(k, v['id']) - for k, v in six.iteritems(response._info)])) + for k, v in response._info.items()])) class DeleteImpliedRole(command.Command): diff --git a/openstackclient/identity/v3/limit.py b/openstackclient/identity/v3/limit.py index f2af81e9f0..b155cbd863 100644 --- a/openstackclient/identity/v3/limit.py +++ b/openstackclient/identity/v3/limit.py @@ -18,7 +18,6 @@ import logging from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ from openstackclient.identity import common as common_utils @@ -102,7 +101,7 @@ class CreateLimit(command.ShowOne): ) limit._info.pop('links', None) - return zip(*sorted(six.iteritems(limit._info))) + return zip(*sorted(limit._info.items())) class ListLimit(command.Lister): @@ -198,7 +197,7 @@ class ShowLimit(command.ShowOne): identity_client = self.app.client_manager.identity limit = identity_client.limits.get(parsed_args.limit_id) limit._info.pop('links', None) - return zip(*sorted(six.iteritems(limit._info))) + return zip(*sorted(limit._info.items())) class SetLimit(command.ShowOne): @@ -236,7 +235,7 @@ class SetLimit(command.ShowOne): limit._info.pop('links', None) - return zip(*sorted(six.iteritems(limit._info))) + return zip(*sorted(limit._info.items())) class DeleteLimit(command.Command): diff --git a/openstackclient/identity/v3/mapping.py b/openstackclient/identity/v3/mapping.py index e729c410c8..7d40a2b7f9 100644 --- a/openstackclient/identity/v3/mapping.py +++ b/openstackclient/identity/v3/mapping.py @@ -21,7 +21,6 @@ import logging from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ @@ -107,7 +106,7 @@ class CreateMapping(command.ShowOne, _RulesReader): rules=rules) mapping._info.pop('links', None) - return zip(*sorted(six.iteritems(mapping._info))) + return zip(*sorted(mapping._info.items())) class DeleteMapping(command.Command): @@ -202,4 +201,4 @@ class ShowMapping(command.ShowOne): mapping = identity_client.federation.mappings.get(parsed_args.mapping) mapping._info.pop('links', None) - return zip(*sorted(six.iteritems(mapping._info))) + return zip(*sorted(mapping._info.items())) diff --git a/openstackclient/identity/v3/policy.py b/openstackclient/identity/v3/policy.py index 3b6441959b..45674210f0 100644 --- a/openstackclient/identity/v3/policy.py +++ b/openstackclient/identity/v3/policy.py @@ -20,7 +20,6 @@ import logging from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ @@ -57,7 +56,7 @@ class CreatePolicy(command.ShowOne): policy._info.pop('links') policy._info.update({'rules': policy._info.pop('blob')}) - return zip(*sorted(six.iteritems(policy._info))) + return zip(*sorted(policy._info.items())) class DeletePolicy(command.Command): @@ -176,4 +175,4 @@ class ShowPolicy(command.ShowOne): policy._info.pop('links') policy._info.update({'rules': policy._info.pop('blob')}) - return zip(*sorted(six.iteritems(policy._info))) + return zip(*sorted(policy._info.items())) diff --git a/openstackclient/identity/v3/project.py b/openstackclient/identity/v3/project.py index 073fb6df11..9ecc70ef4e 100644 --- a/openstackclient/identity/v3/project.py +++ b/openstackclient/identity/v3/project.py @@ -22,7 +22,6 @@ from osc_lib.cli import parseractions from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ from openstackclient.identity import common @@ -124,7 +123,7 @@ class CreateProject(command.ShowOne): raise project._info.pop('links') - return zip(*sorted(six.iteritems(project._info))) + return zip(*sorted(project._info.items())) class DeleteProject(command.Command): @@ -401,4 +400,4 @@ class ShowProject(command.ShowOne): subtree_as_ids=parsed_args.children) project._info.pop('links') - return zip(*sorted(six.iteritems(project._info))) + return zip(*sorted(project._info.items())) diff --git a/openstackclient/identity/v3/region.py b/openstackclient/identity/v3/region.py index 69c8b5066a..20ee073c3b 100644 --- a/openstackclient/identity/v3/region.py +++ b/openstackclient/identity/v3/region.py @@ -18,7 +18,6 @@ import logging from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ @@ -62,7 +61,7 @@ class CreateRegion(command.ShowOne): region._info['region'] = region._info.pop('id') region._info['parent_region'] = region._info.pop('parent_region_id') region._info.pop('links', None) - return zip(*sorted(six.iteritems(region._info))) + return zip(*sorted(region._info.items())) class DeleteRegion(command.Command): @@ -181,4 +180,4 @@ class ShowRegion(command.ShowOne): region._info['region'] = region._info.pop('id') region._info['parent_region'] = region._info.pop('parent_region_id') region._info.pop('links', None) - return zip(*sorted(six.iteritems(region._info))) + return zip(*sorted(region._info.items())) diff --git a/openstackclient/identity/v3/registered_limit.py b/openstackclient/identity/v3/registered_limit.py index 9366ec1efc..53117c71ae 100644 --- a/openstackclient/identity/v3/registered_limit.py +++ b/openstackclient/identity/v3/registered_limit.py @@ -18,7 +18,6 @@ import logging from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ from openstackclient.identity import common as common_utils @@ -92,7 +91,7 @@ class CreateRegisteredLimit(command.ShowOne): ) registered_limit._info.pop('links', None) - return zip(*sorted(six.iteritems(registered_limit._info))) + return zip(*sorted(registered_limit._info.items())) class DeleteRegisteredLimit(command.Command): @@ -275,7 +274,7 @@ class SetRegisteredLimit(command.ShowOne): ) registered_limit._info.pop('links', None) - return zip(*sorted(six.iteritems(registered_limit._info))) + return zip(*sorted(registered_limit._info.items())) class ShowRegisteredLimit(command.ShowOne): @@ -296,4 +295,4 @@ class ShowRegisteredLimit(command.ShowOne): parsed_args.registered_limit_id ) registered_limit._info.pop('links', None) - return zip(*sorted(six.iteritems(registered_limit._info))) + return zip(*sorted(registered_limit._info.items())) diff --git a/openstackclient/identity/v3/role.py b/openstackclient/identity/v3/role.py index 0eeddd37fb..986f823fcf 100644 --- a/openstackclient/identity/v3/role.py +++ b/openstackclient/identity/v3/role.py @@ -21,7 +21,6 @@ from keystoneauth1 import exceptions as ks_exc from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ from openstackclient.identity import common @@ -211,7 +210,7 @@ class CreateRole(command.ShowOne): raise role._info.pop('links') - return zip(*sorted(six.iteritems(role._info))) + return zip(*sorted(role._info.items())) class DeleteRole(command.Command): @@ -403,4 +402,4 @@ class ShowRole(command.ShowOne): domain_id=domain_id) role._info.pop('links') - return zip(*sorted(six.iteritems(role._info))) + return zip(*sorted(role._info.items())) diff --git a/openstackclient/identity/v3/service.py b/openstackclient/identity/v3/service.py index ac8d8d9eef..9dc6696251 100644 --- a/openstackclient/identity/v3/service.py +++ b/openstackclient/identity/v3/service.py @@ -20,7 +20,6 @@ import logging from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ from openstackclient.identity import common @@ -77,7 +76,7 @@ class CreateService(command.ShowOne): ) service._info.pop('links') - return zip(*sorted(six.iteritems(service._info))) + return zip(*sorted(service._info.items())) class DeleteService(command.Command): @@ -218,4 +217,4 @@ class ShowService(command.ShowOne): service = common.find_service(identity_client, parsed_args.service) service._info.pop('links') - return zip(*sorted(six.iteritems(service._info))) + return zip(*sorted(service._info.items())) diff --git a/openstackclient/identity/v3/service_provider.py b/openstackclient/identity/v3/service_provider.py index bb2d9917b4..e106c787b4 100644 --- a/openstackclient/identity/v3/service_provider.py +++ b/openstackclient/identity/v3/service_provider.py @@ -18,7 +18,6 @@ import logging from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ @@ -83,7 +82,7 @@ class CreateServiceProvider(command.ShowOne): sp_url=parsed_args.service_provider_url) sp._info.pop('links', None) - return zip(*sorted(six.iteritems(sp._info))) + return zip(*sorted(sp._info.items())) class DeleteServiceProvider(command.Command): @@ -211,4 +210,4 @@ class ShowServiceProvider(command.ShowOne): id=parsed_args.service_provider) service_provider._info.pop('links', None) - return zip(*sorted(six.iteritems(service_provider._info))) + return zip(*sorted(service_provider._info.items())) diff --git a/openstackclient/identity/v3/token.py b/openstackclient/identity/v3/token.py index 1933ecad65..f14dd8bc3e 100644 --- a/openstackclient/identity/v3/token.py +++ b/openstackclient/identity/v3/token.py @@ -18,7 +18,6 @@ from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ from openstackclient.identity import common @@ -62,7 +61,7 @@ class AuthorizeRequestToken(command.ShowOne): parsed_args.request_key, roles) - return zip(*sorted(six.iteritems(verifier_pin._info))) + return zip(*sorted(verifier_pin._info.items())) class CreateAccessToken(command.ShowOne): @@ -108,7 +107,7 @@ class CreateAccessToken(command.ShowOne): parsed_args.consumer_key, parsed_args.consumer_secret, parsed_args.request_key, parsed_args.request_secret, parsed_args.verifier) - return zip(*sorted(six.iteritems(access_token._info))) + return zip(*sorted(access_token._info.items())) class CreateRequestToken(command.ShowOne): @@ -160,7 +159,7 @@ class CreateRequestToken(command.ShowOne): parsed_args.consumer_key, parsed_args.consumer_secret, project.id) - return zip(*sorted(six.iteritems(request_token._info))) + return zip(*sorted(request_token._info.items())) class IssueToken(command.ShowOne): @@ -198,7 +197,7 @@ class IssueToken(command.ShowOne): # deployment system. When that happens, this will have to relay # scope information and IDs like we do for projects and domains. data['system'] = 'all' - return zip(*sorted(six.iteritems(data))) + return zip(*sorted(data.items())) class RevokeToken(command.Command): diff --git a/openstackclient/identity/v3/trust.py b/openstackclient/identity/v3/trust.py index 155063bb39..cd3a65d0da 100644 --- a/openstackclient/identity/v3/trust.py +++ b/openstackclient/identity/v3/trust.py @@ -20,7 +20,6 @@ from keystoneclient import exceptions as identity_exc from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ from openstackclient.identity import common @@ -136,7 +135,7 @@ class CreateTrust(command.ShowOne): msg = ' '.join(r['name'] for r in roles) trust._info['roles'] = msg - return zip(*sorted(six.iteritems(trust._info))) + return zip(*sorted(trust._info.items())) class DeleteTrust(command.Command): @@ -213,4 +212,4 @@ class ShowTrust(command.ShowOne): msg = ' '.join(r['name'] for r in roles) trust._info['roles'] = msg - return zip(*sorted(six.iteritems(trust._info))) + return zip(*sorted(trust._info.items())) diff --git a/openstackclient/identity/v3/user.py b/openstackclient/identity/v3/user.py index 5f4fb544fe..ca85c5d8a8 100644 --- a/openstackclient/identity/v3/user.py +++ b/openstackclient/identity/v3/user.py @@ -22,7 +22,6 @@ from keystoneauth1 import exceptions as ks_exc from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ from openstackclient.identity import common @@ -135,7 +134,7 @@ class CreateUser(command.ShowOne): raise user._info.pop('links') - return zip(*sorted(six.iteritems(user._info))) + return zip(*sorted(user._info.items())) class DeleteUser(command.Command): @@ -486,4 +485,4 @@ class ShowUser(command.ShowOne): user_str) user._info.pop('links') - return zip(*sorted(six.iteritems(user._info))) + return zip(*sorted(user._info.items())) diff --git a/openstackclient/image/v1/image.py b/openstackclient/image/v1/image.py index c2dab3eec3..a711a1288b 100644 --- a/openstackclient/image/v1/image.py +++ b/openstackclient/image/v1/image.py @@ -28,7 +28,6 @@ from osc_lib.cli import format_columns from osc_lib.cli import parseractions from osc_lib.command import command from osc_lib import utils -import six from openstackclient.i18n import _ @@ -271,7 +270,7 @@ class CreateImage(command.ShowOne): info.update(image._info) info['properties'] = format_columns.DictColumn( info.get('properties', {})) - return zip(*sorted(six.iteritems(info))) + return zip(*sorted(info.items())) class DeleteImage(command.Command): @@ -718,4 +717,4 @@ class ShowImage(command.ShowOne): info['size'] = utils.format_size(info['size']) info['properties'] = format_columns.DictColumn( info.get('properties', {})) - return zip(*sorted(six.iteritems(info))) + return zip(*sorted(info.items())) diff --git a/openstackclient/image/v2/image.py b/openstackclient/image/v2/image.py index 2b10c3adda..feeb256744 100644 --- a/openstackclient/image/v2/image.py +++ b/openstackclient/image/v2/image.py @@ -110,7 +110,7 @@ class AddProjectToImage(command.ShowOne): project_id, ) - return zip(*sorted(six.iteritems(image_member))) + return zip(*sorted(image_member.items())) class CreateImage(command.ShowOne): @@ -292,7 +292,7 @@ class CreateImage(command.ShowOne): # properties should get flattened into the general kwargs if getattr(parsed_args, 'properties', None): - for k, v in six.iteritems(parsed_args.properties): + for k, v in parsed_args.properties.items(): kwargs[k] = str(v) # Handle exclusive booleans with care @@ -417,7 +417,7 @@ class CreateImage(command.ShowOne): if not info: info = _format_image(image) - return zip(*sorted(six.iteritems(info))) + return zip(*sorted(info.items())) class DeleteImage(command.Command): @@ -969,7 +969,7 @@ class SetImage(command.Command): # Properties should get flattened into the general kwargs if getattr(parsed_args, 'properties', None): - for k, v in six.iteritems(parsed_args.properties): + for k, v in parsed_args.properties.items(): kwargs[k] = str(v) # Handle exclusive booleans with care @@ -1066,7 +1066,7 @@ class ShowImage(command.ShowOne): image['size'] = utils.format_size(image['size']) info = _format_image(image) - return zip(*sorted(six.iteritems(info))) + return zip(*sorted(info.items())) class UnsetImage(command.Command): diff --git a/openstackclient/network/sdk_utils.py b/openstackclient/network/sdk_utils.py index 9f0856175d..af9c74f944 100644 --- a/openstackclient/network/sdk_utils.py +++ b/openstackclient/network/sdk_utils.py @@ -10,8 +10,6 @@ # License for the specific language governing permissions and limitations # under the License. -import six - def get_osc_show_columns_for_sdk_resource( sdk_resource, @@ -44,7 +42,7 @@ def get_osc_show_columns_for_sdk_resource( for col_name in invisible_columns: if col_name in display_columns: display_columns.remove(col_name) - for sdk_attr, osc_attr in six.iteritems(osc_column_map): + for sdk_attr, osc_attr in osc_column_map.items(): if sdk_attr in display_columns: attr_map[osc_attr] = sdk_attr display_columns.remove(sdk_attr) diff --git a/openstackclient/network/v2/network_segment_range.py b/openstackclient/network/v2/network_segment_range.py index f03bcc1c0b..2cdae642e5 100644 --- a/openstackclient/network/v2/network_segment_range.py +++ b/openstackclient/network/v2/network_segment_range.py @@ -61,7 +61,7 @@ def _is_prop_empty(columns, props, prop_name): def _exchange_dict_keys_with_values(orig_dict): updated_dict = dict() - for k, v in six.iteritems(orig_dict): + for k, v in orig_dict.items(): k = [k] if not updated_dict.get(v): updated_dict[v] = k @@ -80,7 +80,7 @@ def _update_available_from_props(columns, props): def _update_used_from_props(columns, props): index_used = columns.index('used') updated_used = _exchange_dict_keys_with_values(props[index_used]) - for k, v in six.iteritems(updated_used): + for k, v in updated_used.items(): updated_used[k] = list(_get_ranges(v)) props = _hack_tuple_value_update_by_index( props, index_used, updated_used) diff --git a/openstackclient/network/v2/security_group.py b/openstackclient/network/v2/security_group.py index 9f0ca0a1f4..24f71ab678 100644 --- a/openstackclient/network/v2/security_group.py +++ b/openstackclient/network/v2/security_group.py @@ -19,7 +19,6 @@ from cliff import columns as cliff_columns from osc_lib.cli import format_columns from osc_lib.command import command from osc_lib import utils -import six from openstackclient.i18n import _ from openstackclient.identity import common as identity_common @@ -34,7 +33,7 @@ def _format_network_security_group_rules(sg_rules): # rules, trim keys with caller known (e.g. security group and tenant ID) # or empty values. for sg_rule in sg_rules: - empty_keys = [k for k, v in six.iteritems(sg_rule) if not v] + empty_keys = [k for k, v in sg_rule.items() if not v] for key in empty_keys: sg_rule.pop(key) sg_rule.pop('security_group_id', None) diff --git a/openstackclient/network/v2/security_group_rule.py b/openstackclient/network/v2/security_group_rule.py index a38587fa52..f48478ea74 100644 --- a/openstackclient/network/v2/security_group_rule.py +++ b/openstackclient/network/v2/security_group_rule.py @@ -20,7 +20,6 @@ from osc_lib.cli import format_columns from osc_lib.cli import parseractions from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ from openstackclient.identity import common as identity_common @@ -39,7 +38,7 @@ _formatters = { def _format_security_group_rule_show(obj): data = network_utils.transform_compute_security_group_rule(obj) - return zip(*sorted(six.iteritems(data))) + return zip(*sorted(data.items())) def _format_network_port_range(rule): diff --git a/openstackclient/object/v1/account.py b/openstackclient/object/v1/account.py index 95be8132c9..d6bc9fd780 100644 --- a/openstackclient/object/v1/account.py +++ b/openstackclient/object/v1/account.py @@ -16,7 +16,6 @@ from osc_lib.cli import format_columns from osc_lib.cli import parseractions from osc_lib.command import command -import six from openstackclient.i18n import _ @@ -50,7 +49,7 @@ class ShowAccount(command.ShowOne): if 'properties' in data: data['properties'] = format_columns.DictColumn( data.pop('properties')) - return zip(*sorted(six.iteritems(data))) + return zip(*sorted(data.items())) class UnsetAccount(command.Command): diff --git a/openstackclient/object/v1/container.py b/openstackclient/object/v1/container.py index 02e8d27780..47ca5bc1da 100644 --- a/openstackclient/object/v1/container.py +++ b/openstackclient/object/v1/container.py @@ -21,7 +21,6 @@ from osc_lib.cli import format_columns from osc_lib.cli import parseractions from osc_lib.command import command from osc_lib import utils -import six from openstackclient.i18n import _ @@ -233,7 +232,7 @@ class ShowContainer(command.ShowOne): if 'properties' in data: data['properties'] = format_columns.DictColumn(data['properties']) - return zip(*sorted(six.iteritems(data))) + return zip(*sorted(data.items())) class UnsetContainer(command.Command): diff --git a/openstackclient/object/v1/object.py b/openstackclient/object/v1/object.py index 3747e19e47..01e537eef7 100644 --- a/openstackclient/object/v1/object.py +++ b/openstackclient/object/v1/object.py @@ -22,7 +22,6 @@ from osc_lib.cli import parseractions from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ @@ -287,7 +286,7 @@ class ShowObject(command.ShowOne): if 'properties' in data: data['properties'] = format_columns.DictColumn(data['properties']) - return zip(*sorted(six.iteritems(data))) + return zip(*sorted(data.items())) class UnsetObject(command.Command): diff --git a/openstackclient/tests/unit/common/test_availability_zone.py b/openstackclient/tests/unit/common/test_availability_zone.py index 6c7adc43b6..49e5904dbd 100644 --- a/openstackclient/tests/unit/common/test_availability_zone.py +++ b/openstackclient/tests/unit/common/test_availability_zone.py @@ -13,8 +13,6 @@ import mock -import six - from openstackclient.common import availability_zone from openstackclient.tests.unit.compute.v2 import fakes as compute_fakes from openstackclient.tests.unit import fakes @@ -31,8 +29,8 @@ def _build_compute_az_datalist(compute_az, long_datalist=False): 'available', ) else: - for host, services in six.iteritems(compute_az.hosts): - for service, state in six.iteritems(services): + for host, services in compute_az.hosts.items(): + for service, state in services.items(): datalist += ( compute_az.zoneName, 'available', diff --git a/openstackclient/tests/unit/fakes.py b/openstackclient/tests/unit/fakes.py index bca457e457..59cbbe1055 100644 --- a/openstackclient/tests/unit/fakes.py +++ b/openstackclient/tests/unit/fakes.py @@ -200,7 +200,7 @@ class FakeResource(object): self._loaded = loaded def _add_details(self, info): - for (k, v) in six.iteritems(info): + for (k, v) in info.items(): setattr(self, k, v) def _add_methods(self, methods): @@ -211,7 +211,7 @@ class FakeResource(object): @value. When users access the attribute with (), @value will be returned, which looks like a function call. """ - for (name, ret) in six.iteritems(methods): + for (name, ret) in methods.items(): method = mock.Mock(return_value=ret) setattr(self, name, method) diff --git a/openstackclient/volume/v1/qos_specs.py b/openstackclient/volume/v1/qos_specs.py index 0b6a7fa0ca..79dff1c677 100644 --- a/openstackclient/volume/v1/qos_specs.py +++ b/openstackclient/volume/v1/qos_specs.py @@ -22,7 +22,6 @@ from osc_lib.cli import parseractions from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ @@ -99,7 +98,7 @@ class CreateQos(command.ShowOne): {'properties': format_columns.DictColumn(qos_spec._info.pop('specs'))} ) - return zip(*sorted(six.iteritems(qos_spec._info))) + return zip(*sorted(qos_spec._info.items())) class DeleteQos(command.Command): @@ -273,7 +272,7 @@ class ShowQos(command.ShowOne): {'properties': format_columns.DictColumn(qos_spec._info.pop('specs'))}) - return zip(*sorted(six.iteritems(qos_spec._info))) + return zip(*sorted(qos_spec._info.items())) class UnsetQos(command.Command): diff --git a/openstackclient/volume/v1/volume.py b/openstackclient/volume/v1/volume.py index 36c7ef8985..460bd85a8b 100644 --- a/openstackclient/volume/v1/volume.py +++ b/openstackclient/volume/v1/volume.py @@ -25,7 +25,6 @@ from osc_lib.cli import parseractions from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ @@ -253,7 +252,7 @@ class CreateVolume(command.ShowOne): volume._info, parsed_args.columns, {'display_name': 'name'} ) - return zip(*sorted(six.iteritems(volume_info))) + return zip(*sorted(volume_info.items())) class DeleteVolume(command.Command): @@ -614,7 +613,7 @@ class ShowVolume(command.ShowOne): volume._info, parsed_args.columns, {'display_name': 'name'} ) - return zip(*sorted(six.iteritems(volume_info))) + return zip(*sorted(volume_info.items())) class UnsetVolume(command.Command): diff --git a/openstackclient/volume/v1/volume_backup.py b/openstackclient/volume/v1/volume_backup.py index 2daa23cb92..1a83a3c040 100644 --- a/openstackclient/volume/v1/volume_backup.py +++ b/openstackclient/volume/v1/volume_backup.py @@ -23,7 +23,6 @@ from cliff import columns as cliff_columns from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ @@ -98,7 +97,7 @@ class CreateVolumeBackup(command.ShowOne): ) backup._info.pop('links') - return zip(*sorted(six.iteritems(backup._info))) + return zip(*sorted(backup._info.items())) class DeleteVolumeBackup(command.Command): @@ -263,4 +262,4 @@ class ShowVolumeBackup(command.ShowOne): backup = utils.find_resource(volume_client.backups, parsed_args.backup) backup._info.pop('links') - return zip(*sorted(six.iteritems(backup._info))) + return zip(*sorted(backup._info.items())) diff --git a/openstackclient/volume/v1/volume_snapshot.py b/openstackclient/volume/v1/volume_snapshot.py index 50f81771a0..966db48ff1 100644 --- a/openstackclient/volume/v1/volume_snapshot.py +++ b/openstackclient/volume/v1/volume_snapshot.py @@ -25,7 +25,6 @@ from osc_lib.cli import parseractions from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ @@ -110,7 +109,7 @@ class CreateVolumeSnapshot(command.ShowOne): format_columns.DictColumn(snapshot._info.pop('metadata'))} ) - return zip(*sorted(six.iteritems(snapshot._info))) + return zip(*sorted(snapshot._info.items())) class DeleteVolumeSnapshot(command.Command): @@ -342,7 +341,7 @@ class ShowVolumeSnapshot(command.ShowOne): format_columns.DictColumn(snapshot._info.pop('metadata'))} ) - return zip(*sorted(six.iteritems(snapshot._info))) + return zip(*sorted(snapshot._info.items())) class UnsetVolumeSnapshot(command.Command): diff --git a/openstackclient/volume/v1/volume_transfer_request.py b/openstackclient/volume/v1/volume_transfer_request.py index 6f79658e5a..971b9ab592 100644 --- a/openstackclient/volume/v1/volume_transfer_request.py +++ b/openstackclient/volume/v1/volume_transfer_request.py @@ -19,7 +19,6 @@ import logging from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ @@ -67,7 +66,7 @@ class AcceptTransferRequest(command.ShowOne): ) transfer_accept._info.pop("links", None) - return zip(*sorted(six.iteritems(transfer_accept._info))) + return zip(*sorted(transfer_accept._info.items())) class CreateTransferRequest(command.ShowOne): @@ -99,7 +98,7 @@ class CreateTransferRequest(command.ShowOne): ) volume_transfer_request._info.pop("links", None) - return zip(*sorted(six.iteritems(volume_transfer_request._info))) + return zip(*sorted(volume_transfer_request._info.items())) class DeleteTransferRequest(command.Command): @@ -189,4 +188,4 @@ class ShowTransferRequest(command.ShowOne): ) volume_transfer_request._info.pop("links", None) - return zip(*sorted(six.iteritems(volume_transfer_request._info))) + return zip(*sorted(volume_transfer_request._info.items())) diff --git a/openstackclient/volume/v1/volume_type.py b/openstackclient/volume/v1/volume_type.py index e744e92fdb..4f015d13f6 100644 --- a/openstackclient/volume/v1/volume_type.py +++ b/openstackclient/volume/v1/volume_type.py @@ -24,7 +24,6 @@ from osc_lib.cli import parseractions from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ @@ -162,7 +161,7 @@ class CreateVolumeType(command.ShowOne): {'encryption': format_columns.DictColumn(encryption._info)}) volume_type._info.pop("os-volume-type-access:is_public", None) - return zip(*sorted(six.iteritems(volume_type._info))) + return zip(*sorted(volume_type._info.items())) class DeleteVolumeType(command.Command): @@ -388,7 +387,7 @@ class ShowVolumeType(command.ShowOne): LOG.error(_("Failed to display the encryption information " "of this volume type: %s"), e) volume_type._info.pop("os-volume-type-access:is_public", None) - return zip(*sorted(six.iteritems(volume_type._info))) + return zip(*sorted(volume_type._info.items())) class UnsetVolumeType(command.Command): diff --git a/openstackclient/volume/v2/backup_record.py b/openstackclient/volume/v2/backup_record.py index f491803272..64ff4f67ad 100644 --- a/openstackclient/volume/v2/backup_record.py +++ b/openstackclient/volume/v2/backup_record.py @@ -18,7 +18,6 @@ import logging from osc_lib.command import command from osc_lib import utils -import six from openstackclient.i18n import _ @@ -51,7 +50,7 @@ class ExportBackupRecord(command.ShowOne): backup_data['Backup Service'] = backup_data.pop('backup_service') backup_data['Metadata'] = backup_data.pop('backup_url') - return zip(*sorted(six.iteritems(backup_data))) + return zip(*sorted(backup_data.items())) class ImportBackupRecord(command.ShowOne): @@ -79,4 +78,4 @@ class ImportBackupRecord(command.ShowOne): parsed_args.backup_service, parsed_args.backup_metadata) backup_data.pop('links', None) - return zip(*sorted(six.iteritems(backup_data))) + return zip(*sorted(backup_data.items())) diff --git a/openstackclient/volume/v2/consistency_group.py b/openstackclient/volume/v2/consistency_group.py index 26dd8ffca1..c50a1b5bb2 100644 --- a/openstackclient/volume/v2/consistency_group.py +++ b/openstackclient/volume/v2/consistency_group.py @@ -20,7 +20,6 @@ from osc_lib.cli import format_columns from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ @@ -161,7 +160,7 @@ class CreateConsistencyGroup(command.ShowOne): ) ) - return zip(*sorted(six.iteritems(consistency_group._info))) + return zip(*sorted(consistency_group._info.items())) class DeleteConsistencyGroup(command.Command): @@ -335,4 +334,4 @@ class ShowConsistencyGroup(command.ShowOne): consistency_group = utils.find_resource( volume_client.consistencygroups, parsed_args.consistency_group) - return zip(*sorted(six.iteritems(consistency_group._info))) + return zip(*sorted(consistency_group._info.items())) diff --git a/openstackclient/volume/v2/consistency_group_snapshot.py b/openstackclient/volume/v2/consistency_group_snapshot.py index 540deb0187..3df66e6962 100644 --- a/openstackclient/volume/v2/consistency_group_snapshot.py +++ b/openstackclient/volume/v2/consistency_group_snapshot.py @@ -19,7 +19,6 @@ import logging from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ @@ -68,7 +67,7 @@ class CreateConsistencyGroupSnapshot(command.ShowOne): description=parsed_args.description, ) - return zip(*sorted(six.iteritems(consistency_group_snapshot._info))) + return zip(*sorted(consistency_group_snapshot._info.items())) class DeleteConsistencyGroupSnapshot(command.Command): @@ -187,4 +186,4 @@ class ShowConsistencyGroupSnapshot(command.ShowOne): consistency_group_snapshot = utils.find_resource( volume_client.cgsnapshots, parsed_args.consistency_group_snapshot) - return zip(*sorted(six.iteritems(consistency_group_snapshot._info))) + return zip(*sorted(consistency_group_snapshot._info.items())) diff --git a/openstackclient/volume/v2/qos_specs.py b/openstackclient/volume/v2/qos_specs.py index 3037d34ae8..e6e6b9f8b7 100644 --- a/openstackclient/volume/v2/qos_specs.py +++ b/openstackclient/volume/v2/qos_specs.py @@ -22,7 +22,6 @@ from osc_lib.cli import parseractions from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ @@ -100,7 +99,7 @@ class CreateQos(command.ShowOne): {'properties': format_columns.DictColumn(qos_spec._info.pop('specs'))} ) - return zip(*sorted(six.iteritems(qos_spec._info))) + return zip(*sorted(qos_spec._info.items())) class DeleteQos(command.Command): @@ -275,7 +274,7 @@ class ShowQos(command.ShowOne): {'properties': format_columns.DictColumn(qos_spec._info.pop('specs'))}) - return zip(*sorted(six.iteritems(qos_spec._info))) + return zip(*sorted(qos_spec._info.items())) class UnsetQos(command.Command): diff --git a/openstackclient/volume/v2/volume.py b/openstackclient/volume/v2/volume.py index 17ccd3d31e..4dde1340a7 100644 --- a/openstackclient/volume/v2/volume.py +++ b/openstackclient/volume/v2/volume.py @@ -25,7 +25,6 @@ from osc_lib.cli import parseractions from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ from openstackclient.identity import common as identity_common @@ -252,7 +251,7 @@ class CreateVolume(command.ShowOne): } ) volume._info.pop("links", None) - return zip(*sorted(six.iteritems(volume._info))) + return zip(*sorted(volume._info.items())) class DeleteVolume(command.Command): @@ -751,7 +750,7 @@ class ShowVolume(command.ShowOne): # Remove key links from being displayed volume._info.pop("links", None) - return zip(*sorted(six.iteritems(volume._info))) + return zip(*sorted(volume._info.items())) class UnsetVolume(command.Command): diff --git a/openstackclient/volume/v2/volume_backup.py b/openstackclient/volume/v2/volume_backup.py index 4d0d54c1b5..c336f6c9ac 100644 --- a/openstackclient/volume/v2/volume_backup.py +++ b/openstackclient/volume/v2/volume_backup.py @@ -23,7 +23,6 @@ from osc_lib.cli import parseractions from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ @@ -120,7 +119,7 @@ class CreateVolumeBackup(command.ShowOne): snapshot_id=snapshot_id, ) backup._info.pop("links", None) - return zip(*sorted(six.iteritems(backup._info))) + return zip(*sorted(backup._info.items())) class DeleteVolumeBackup(command.Command): @@ -289,7 +288,7 @@ class RestoreVolumeBackup(command.ShowOne): parsed_args.volume) backup = volume_client.restores.restore(backup.id, destination_volume.id) - return zip(*sorted(six.iteritems(backup._info))) + return zip(*sorted(backup._info.items())) class SetVolumeBackup(command.Command): @@ -371,4 +370,4 @@ class ShowVolumeBackup(command.ShowOne): backup = utils.find_resource(volume_client.backups, parsed_args.backup) backup._info.pop("links", None) - return zip(*sorted(six.iteritems(backup._info))) + return zip(*sorted(backup._info.items())) diff --git a/openstackclient/volume/v2/volume_snapshot.py b/openstackclient/volume/v2/volume_snapshot.py index 2b26ae323b..edacf68364 100644 --- a/openstackclient/volume/v2/volume_snapshot.py +++ b/openstackclient/volume/v2/volume_snapshot.py @@ -24,7 +24,6 @@ from osc_lib.cli import parseractions from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ from openstackclient.identity import common as identity_common @@ -140,7 +139,7 @@ class CreateVolumeSnapshot(command.ShowOne): {'properties': format_columns.DictColumn(snapshot._info.pop('metadata'))} ) - return zip(*sorted(six.iteritems(snapshot._info))) + return zip(*sorted(snapshot._info.items())) class DeleteVolumeSnapshot(command.Command): @@ -426,7 +425,7 @@ class ShowVolumeSnapshot(command.ShowOne): {'properties': format_columns.DictColumn(snapshot._info.pop('metadata'))} ) - return zip(*sorted(six.iteritems(snapshot._info))) + return zip(*sorted(snapshot._info.items())) class UnsetVolumeSnapshot(command.Command): diff --git a/openstackclient/volume/v2/volume_transfer_request.py b/openstackclient/volume/v2/volume_transfer_request.py index 4c4741bc30..2a1ace1f42 100644 --- a/openstackclient/volume/v2/volume_transfer_request.py +++ b/openstackclient/volume/v2/volume_transfer_request.py @@ -19,7 +19,6 @@ import logging from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ @@ -64,7 +63,7 @@ class AcceptTransferRequest(command.ShowOne): ) transfer_accept._info.pop("links", None) - return zip(*sorted(six.iteritems(transfer_accept._info))) + return zip(*sorted(transfer_accept._info.items())) class CreateTransferRequest(command.ShowOne): @@ -96,7 +95,7 @@ class CreateTransferRequest(command.ShowOne): ) volume_transfer_request._info.pop("links", None) - return zip(*sorted(six.iteritems(volume_transfer_request._info))) + return zip(*sorted(volume_transfer_request._info.items())) class DeleteTransferRequest(command.Command): @@ -186,4 +185,4 @@ class ShowTransferRequest(command.ShowOne): ) volume_transfer_request._info.pop("links", None) - return zip(*sorted(six.iteritems(volume_transfer_request._info))) + return zip(*sorted(volume_transfer_request._info.items())) diff --git a/openstackclient/volume/v2/volume_type.py b/openstackclient/volume/v2/volume_type.py index 54b1f49719..483e6dd3b5 100644 --- a/openstackclient/volume/v2/volume_type.py +++ b/openstackclient/volume/v2/volume_type.py @@ -23,7 +23,6 @@ from osc_lib.cli import parseractions from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils -import six from openstackclient.i18n import _ from openstackclient.identity import common as identity_common @@ -235,7 +234,7 @@ class CreateVolumeType(command.ShowOne): {'encryption': format_columns.DictColumn(encryption._info)}) volume_type._info.pop("os-volume-type-access:is_public", None) - return zip(*sorted(six.iteritems(volume_type._info))) + return zip(*sorted(volume_type._info.items())) class DeleteVolumeType(command.Command): @@ -553,7 +552,7 @@ class ShowVolumeType(command.ShowOne): LOG.error(_("Failed to display the encryption information " "of this volume type: %s"), e) volume_type._info.pop("os-volume-type-access:is_public", None) - return zip(*sorted(six.iteritems(volume_type._info))) + return zip(*sorted(volume_type._info.items())) class UnsetVolumeType(command.Command):