diff --git a/manila/api/common.py b/manila/api/common.py index 456b03bdf7..516ce761d5 100644 --- a/manila/api/common.py +++ b/manila/api/common.py @@ -18,7 +18,6 @@ import re from oslo_config import cfg from oslo_log import log -import six from six.moves.urllib import parse import webob @@ -193,7 +192,7 @@ def dict_to_query_str(params): # TODO(throughnothing): we should just use urllib.urlencode instead of this # But currently we don't work with urlencoded url's param_str = "" - for key, val in six.iteritems(params): + for key, val in params.items(): param_str = param_str + '='.join([str(key), str(val)]) + '&' return param_str.rstrip('&') diff --git a/manila/api/extensions.py b/manila/api/extensions.py index f338a5361f..fe599f80c3 100644 --- a/manila/api/extensions.py +++ b/manila/api/extensions.py @@ -96,7 +96,7 @@ class ExtensionsResource(wsgi.Resource): def index(self, req): extensions = [] - for _alias, ext in six.iteritems(self.extension_manager.extensions): + for _alias, ext in self.extension_manager.extensions.items(): extensions.append(self._translate(ext)) return dict(extensions=extensions) diff --git a/manila/api/v1/security_service.py b/manila/api/v1/security_service.py index c0ffb37afc..1f7681876d 100644 --- a/manila/api/v1/security_service.py +++ b/manila/api/v1/security_service.py @@ -16,7 +16,6 @@ """The security service api.""" from oslo_log import log -import six import webob from webob import exc @@ -124,7 +123,7 @@ class SecurityServiceController(wsgi.Controller): not_found = object() for ss in security_services: if all(ss.get(opt, not_found) == value for opt, value in - six.iteritems(search_opts)): + search_opts.items()): results.append(ss) security_services = results diff --git a/manila/api/v1/share_networks.py b/manila/api/v1/share_networks.py index 1968f9a51f..b0d19fa28b 100644 --- a/manila/api/v1/share_networks.py +++ b/manila/api/v1/share_networks.py @@ -164,7 +164,7 @@ class ShareNetworkController(wsgi.Controller): for opt in opts_to_remove: search_opts.pop(opt, None) if search_opts: - for key, value in six.iteritems(search_opts): + for key, value in search_opts.items(): if key in ['ip_version', 'segmentation_id']: value = int(value) networks = [network for network in networks @@ -284,7 +284,7 @@ class ShareNetworkController(wsgi.Controller): 'add_security_service': self._add_security_service, 'remove_security_service': self._remove_security_service } - for action, data in six.iteritems(body): + for action, data in body.items(): try: return _actions[action](req, id, data) except KeyError: diff --git a/manila/api/v1/share_servers.py b/manila/api/v1/share_servers.py index f6d102de12..dcec8aeac4 100644 --- a/manila/api/v1/share_servers.py +++ b/manila/api/v1/share_servers.py @@ -55,7 +55,7 @@ class ShareServerController(wsgi.Controller): else: s.share_network_name = s.share_network_id if search_opts: - for k, v in six.iteritems(search_opts): + for k, v in search_opts.items(): share_servers = [s for s in share_servers if (hasattr(s, k) and s[k] == v or k == 'share_network' and diff --git a/manila/api/v1/share_snapshots.py b/manila/api/v1/share_snapshots.py index a071282c2b..eb44e747e4 100644 --- a/manila/api/v1/share_snapshots.py +++ b/manila/api/v1/share_snapshots.py @@ -16,7 +16,6 @@ """The share snapshots api.""" from oslo_log import log -import six import webob from webob import exc @@ -208,7 +207,7 @@ class ShareSnapshotsController(wsgi.Controller, wsgi.AdminActionsMixin): snapshot.get('display_name'), snapshot.get('display_description')) return self._view_builder.detail( - req, dict(six.iteritems(new_snapshot))) + req, dict(new_snapshot.items())) def create_resource(): diff --git a/manila/api/v1/share_types_extra_specs.py b/manila/api/v1/share_types_extra_specs.py index 27d22cbc41..acda6fe267 100644 --- a/manila/api/v1/share_types_extra_specs.py +++ b/manila/api/v1/share_types_extra_specs.py @@ -33,7 +33,7 @@ class ShareTypeExtraSpecsController(wsgi.Controller): def _get_extra_specs(self, context, type_id): extra_specs = db.share_type_extra_specs_get(context, type_id) specs_dict = {} - for key, value in six.iteritems(extra_specs): + for key, value in extra_specs.items(): specs_dict[key] = value return dict(extra_specs=specs_dict) @@ -62,7 +62,7 @@ class ShareTypeExtraSpecsController(wsgi.Controller): and valid_type and valid_required_extra_spec) - for k, v in six.iteritems(extra_specs): + for k, v in extra_specs.items(): if is_valid_string(k) and isinstance(v, dict): self._verify_extra_specs(v) elif not is_valid_extra_spec(k, v): diff --git a/manila/api/v1/shares.py b/manila/api/v1/shares.py index fb73585ac4..53548c706b 100644 --- a/manila/api/v1/shares.py +++ b/manila/api/v1/shares.py @@ -324,7 +324,7 @@ class ShareMixin(object): display_description, **kwargs) - return self._view_builder.detail(req, dict(six.iteritems(new_share))) + return self._view_builder.detail(req, dict(new_share.items())) @staticmethod def _validate_common_name(access): diff --git a/manila/api/v2/cgsnapshots.py b/manila/api/v2/cgsnapshots.py index 780ae00d85..f2596cf368 100644 --- a/manila/api/v2/cgsnapshots.py +++ b/manila/api/v2/cgsnapshots.py @@ -179,8 +179,7 @@ class CGSnapshotController(wsgi.Controller, wsgi.AdminActionsMixin): except exception.InvalidConsistencyGroup as e: raise exc.HTTPConflict(explanation=six.text_type(e)) - return self._view_builder.detail(req, dict(six.iteritems( - new_snapshot))) + return self._view_builder.detail(req, dict(new_snapshot.items())) @wsgi.Controller.api_version('2.4', experimental=True) @wsgi.Controller.authorize('get_cgsnapshot') diff --git a/manila/api/v2/consistency_groups.py b/manila/api/v2/consistency_groups.py index 0ef6073a00..84a6186168 100644 --- a/manila/api/v2/consistency_groups.py +++ b/manila/api/v2/consistency_groups.py @@ -213,7 +213,7 @@ class CGController(wsgi.Controller, wsgi.AdminActionsMixin): except (exception.CGSnapshotNotFound, exception.InvalidInput) as e: raise exc.HTTPBadRequest(explanation=six.text_type(e)) - return self._view_builder.detail(req, dict(six.iteritems(new_cg))) + return self._view_builder.detail(req, dict(new_cg.items())) def _update(self, *args, **kwargs): db.consistency_group_update(*args, **kwargs) diff --git a/manila/cmd/manage.py b/manila/cmd/manage.py index 75afff9ca2..c9a274608d 100755 --- a/manila/cmd/manage.py +++ b/manila/cmd/manage.py @@ -64,7 +64,6 @@ i18n.enable_lazy() from oslo_config import cfg from oslo_log import log from oslo_utils import uuidutils -import six from manila.common import config # Need to register global_opts # noqa from manila import context @@ -256,7 +255,7 @@ class ConfigCommands(object): """Class for exposing the flags defined by flag_file(s).""" def list(self): - for key, value in six.iteritems(CONF): + for key, value in CONF.items(): if value is not None: print('%s = %s' % (key, value)) diff --git a/manila/db/sqlalchemy/api.py b/manila/db/sqlalchemy/api.py index 81ddce4f14..8e5f845c1b 100644 --- a/manila/db/sqlalchemy/api.py +++ b/manila/db/sqlalchemy/api.py @@ -1292,7 +1292,7 @@ def _share_get_query(context, session=None): def _metadata_refs(metadata_dict, meta_class): metadata_refs = [] if metadata_dict: - for k, v in six.iteritems(metadata_dict): + for k, v in metadata_dict.items(): value = six.text_type(v) if isinstance(v, bool) else v metadata_ref = meta_class() @@ -1978,7 +1978,7 @@ def _share_metadata_update(context, share_id, metadata, delete, session=None): if delete: original_metadata = _share_metadata_get(context, share_id, session=session) - for meta_key, meta_value in six.iteritems(original_metadata): + for meta_key, meta_value in original_metadata.items(): if meta_key not in metadata: meta_ref = _share_metadata_get_item(context, share_id, meta_key, @@ -2900,7 +2900,7 @@ def share_type_extra_specs_update_or_create(context, share_type_id, specs): session = get_session() with session.begin(): spec_ref = None - for key, value in six.iteritems(specs): + for key, value in specs.items(): try: spec_ref = _share_type_extra_specs_get_item( context, share_type_id, key, session) diff --git a/manila/db/sqlalchemy/models.py b/manila/db/sqlalchemy/models.py index 4bf98e434f..daf8fffc6a 100644 --- a/manila/db/sqlalchemy/models.py +++ b/manila/db/sqlalchemy/models.py @@ -22,7 +22,6 @@ SQLAlchemy models for Manila data. from oslo_config import cfg from oslo_db.sqlalchemy import models from oslo_log import log -import six from sqlalchemy import Column, Integer, String, schema from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import orm @@ -45,7 +44,7 @@ class ManilaBase(models.ModelBase, def to_dict(self): model_dict = {} - for k, v in six.iteritems(self): + for k, v in self.items(): if not issubclass(type(v), ManilaBase): model_dict[k] = v return model_dict diff --git a/manila/exception.py b/manila/exception.py index 37d080eae5..111c89989b 100644 --- a/manila/exception.py +++ b/manila/exception.py @@ -81,7 +81,7 @@ class ManilaException(Exception): self.kwargs['code'] = self.code except AttributeError: pass - for k, v in six.iteritems(self.kwargs): + for k, v in self.kwargs.items(): if isinstance(v, Exception): self.kwargs[k] = six.text_type(v) @@ -93,7 +93,7 @@ class ManilaException(Exception): # kwargs doesn't match a variable in the message # log the issue and the kwargs LOG.exception(_LE('Exception in string format operation.')) - for name, value in six.iteritems(kwargs): + for name, value in kwargs.items(): LOG.error(_LE("%(name)s: %(value)s"), { 'name': name, 'value': value}) if CONF.fatal_exception_format_errors: diff --git a/manila/quota.py b/manila/quota.py index b508b2ff77..7b3f620187 100644 --- a/manila/quota.py +++ b/manila/quota.py @@ -237,7 +237,7 @@ class DbQuotaDriver(object): project_id, user_id) # Use the project quota for default user quota. proj_quotas = db.quota_get_all_by_project(context, project_id) - for key, value in six.iteritems(proj_quotas): + for key, value in proj_quotas.items(): if key not in user_quotas.keys(): user_quotas[key] = value user_usages = None diff --git a/manila/scheduler/filters/capabilities.py b/manila/scheduler/filters/capabilities.py index 8f184b7d24..f65c830c29 100644 --- a/manila/scheduler/filters/capabilities.py +++ b/manila/scheduler/filters/capabilities.py @@ -15,8 +15,6 @@ import logging -import six - from manila.scheduler.filters import base_host from manila.scheduler.filters import extra_specs_ops @@ -36,7 +34,7 @@ class CapabilitiesFilter(base_host.BaseHostFilter): if not extra_specs: return True - for key, req in six.iteritems(extra_specs): + for key, req in extra_specs.items(): # Either not scoped format, or in capabilities scope scope = key.split(':') diff --git a/manila/scheduler/host_manager.py b/manila/scheduler/host_manager.py index 7f2a1911bf..34ffc2fbd2 100644 --- a/manila/scheduler/host_manager.py +++ b/manila/scheduler/host_manager.py @@ -505,12 +505,12 @@ class HostManager(object): host_state = self.host_state_cls( host, capabilities=capabilities, - service=dict(six.iteritems(service))) + service=dict(service.items())) self.host_state_map[host] = host_state # Update capabilities and attributes in host_state host_state.update_from_share_capability( - capabilities, service=dict(six.iteritems(service))) + capabilities, service=dict(service.items())) def get_all_host_states_share(self, context): """Returns a dict of all the hosts the HostManager knows about. @@ -579,7 +579,7 @@ class HostManager(object): if not filter_dict: return True - for filter_key, filter_value in six.iteritems(filter_dict): + for filter_key, filter_value in filter_dict.items(): if filter_key not in dict_to_check: return False if not re.match(filter_value, dict_to_check.get(filter_key)): diff --git a/manila/share/api.py b/manila/share/api.py index 70f5cabd7e..a9e92ce4e1 100644 --- a/manila/share/api.py +++ b/manila/share/api.py @@ -715,7 +715,7 @@ class API(base.Base): def get_snapshot(self, context, snapshot_id): policy.check_policy(context, 'share_snapshot', 'get_snapshot') rv = self.db.share_snapshot_get(context, snapshot_id) - return dict(six.iteritems(rv)) + return dict(rv.items()) def get_all_snapshots(self, context, search_opts=None, sort_key='share_id', sort_dir='desc'): @@ -751,7 +751,7 @@ class API(base.Base): results = [] not_found = object() for snapshot in snapshots: - for opt, value in six.iteritems(search_opts): + for opt, value in search_opts.items(): if snapshot.get(opt, not_found) != value: break else: @@ -872,7 +872,7 @@ class API(base.Base): def get_share_metadata(self, context, share): """Get all metadata associated with a share.""" rv = self.db.share_metadata_get(context, share['id']) - return dict(six.iteritems(rv)) + return dict(rv.items()) @policy.wrap_check_policy('share') def delete_share_metadata(self, context, share, key): @@ -893,7 +893,7 @@ class API(base.Base): if not metadata: metadata = {} - for k, v in six.iteritems(metadata): + for k, v in metadata.items(): if not k: msg = _("Metadata property key is blank.") LOG.warning(msg) diff --git a/manila/share/drivers/ganesha/manager.py b/manila/share/drivers/ganesha/manager.py index d69951a592..ee62668dd9 100644 --- a/manila/share/drivers/ganesha/manager.py +++ b/manila/share/drivers/ganesha/manager.py @@ -128,7 +128,7 @@ def _conf2json(conf): def _dump_to_conf(confdict, out=sys.stdout, indent=0): """Output confdict in Ganesha config format.""" if isinstance(confdict, dict): - for k, v in six.iteritems(confdict): + for k, v in confdict.items(): if v is None: continue out.write(' ' * (indent * IWIDTH) + k + ' ') diff --git a/manila/share/drivers/ganesha/utils.py b/manila/share/drivers/ganesha/utils.py index 593b1c00a7..c6548d8373 100644 --- a/manila/share/drivers/ganesha/utils.py +++ b/manila/share/drivers/ganesha/utils.py @@ -17,7 +17,6 @@ import os import pipes from oslo_concurrency import processutils -import six from manila import utils @@ -25,7 +24,7 @@ from manila import utils def patch(base, *overlays): """Recursive dictionary patching.""" for ovl in overlays: - for k, v in six.iteritems(ovl): + for k, v in ovl.items(): if isinstance(v, dict) and isinstance(base.get(k), dict): patch(base[k], v) else: @@ -35,7 +34,7 @@ def patch(base, *overlays): def walk(dct): """Recursive iteration over dictionary.""" - for k, v in six.iteritems(dct): + for k, v in dct.items(): if isinstance(v, dict): for w in walk(v): yield w diff --git a/manila/share/drivers/glusterfs/common.py b/manila/share/drivers/glusterfs/common.py index 97310a89c2..22b3bf706c 100644 --- a/manila/share/drivers/glusterfs/common.py +++ b/manila/share/drivers/glusterfs/common.py @@ -91,7 +91,7 @@ class GlusterManager(object): self.components = (address if isinstance(address, dict) else self.parse(address)) - for k, v in six.iteritems(requires): + for k, v in requires.items(): if v is None: continue if (self.components.get(k) is not None) != v: diff --git a/manila/share/drivers/glusterfs/layout_volume.py b/manila/share/drivers/glusterfs/layout_volume.py index adbff2cb22..6a7e33ed24 100644 --- a/manila/share/drivers/glusterfs/layout_volume.py +++ b/manila/share/drivers/glusterfs/layout_volume.py @@ -109,7 +109,7 @@ class GlusterfsVolumeMappedLayout(layout.GlusterfsShareLayoutBase): """ subdict = {} - for key, val in six.iteritems(PATTERN_DICT): + for key, val in PATTERN_DICT.items(): subdict[key] = val['pattern'] # Using templates with placeholder syntax #{} @@ -131,7 +131,7 @@ class GlusterfsVolumeMappedLayout(layout.GlusterfsShareLayoutBase): except exception.GlusterfsException as exc: exceptions[srvaddr] = six.text_type(exc) if exceptions: - for srvaddr, excmsg in six.iteritems(exceptions): + for srvaddr, excmsg in exceptions.items(): LOG.error(_LE("'gluster version' failed on server " "%(server)s with: %(message)s"), {'server': srvaddr, 'message': excmsg}) @@ -139,7 +139,7 @@ class GlusterfsVolumeMappedLayout(layout.GlusterfsShareLayoutBase): "'gluster version' failed on servers %s") % ( ','.join(exceptions.keys()))) notsupp_servers = [] - for srvaddr, vers in six.iteritems(glusterfs_versions): + for srvaddr, vers in glusterfs_versions.items(): if common.GlusterManager.numreduct( vers) < self.driver.GLUSTERFS_VERSION_MIN: notsupp_servers.append(srvaddr) diff --git a/manila/share/drivers/netapp/dataontap/cluster_mode/lib_base.py b/manila/share/drivers/netapp/dataontap/cluster_mode/lib_base.py index 90ca460db1..ad13fe8e62 100644 --- a/manila/share/drivers/netapp/dataontap/cluster_mode/lib_base.py +++ b/manila/share/drivers/netapp/dataontap/cluster_mode/lib_base.py @@ -1020,9 +1020,9 @@ class NetAppCmodeFileStorageLibrary(object): return raid_types = self._client.get_aggregate_raid_types(aggregate_names) - for aggregate_name, raid_type in six.iteritems(raid_types): + for aggregate_name, raid_type in raid_types.items(): ssc_stats[aggregate_name]['netapp_raid_type'] = raid_type disk_types = self._client.get_aggregate_disk_types(aggregate_names) - for aggregate_name, disk_type in six.iteritems(disk_types): + for aggregate_name, disk_type in disk_types.items(): ssc_stats[aggregate_name]['netapp_disk_type'] = disk_type diff --git a/manila/share/manager.py b/manila/share/manager.py index 8d2de97e70..6474103733 100644 --- a/manila/share/manager.py +++ b/manila/share/manager.py @@ -873,7 +873,7 @@ class ShareManager(manager.SchedulerDependentManager): def _update_quota_usages(self, context, project_id, usages): user_id = context.user_id - for resource, usage in six.iteritems(usages): + for resource, usage in usages.items(): try: current_usage = self.db.quota_usage_get( context, project_id, resource, user_id) diff --git a/manila/share/share_types.py b/manila/share/share_types.py index 94f295ff5e..7a8df6f866 100644 --- a/manila/share/share_types.py +++ b/manila/share/share_types.py @@ -82,7 +82,7 @@ def get_all_types(context, inactive=0, search_opts=None): share_types = db.share_type_get_all(context, inactive, filters=filters) - for type_name, type_args in six.iteritems(share_types): + for type_name, type_args in share_types.items(): required_extra_specs = {} try: required_extra_specs = get_valid_required_extra_specs( @@ -101,7 +101,7 @@ def get_all_types(context, inactive=0, search_opts=None): LOG.debug("Searching by: %s", search_opts) def _check_extra_specs_match(share_type, searchdict): - for k, v in six.iteritems(searchdict): + for k, v in searchdict.items(): if (k not in share_type['extra_specs'].keys() or share_type['extra_specs'][k] != v): return False @@ -111,9 +111,9 @@ def get_all_types(context, inactive=0, search_opts=None): filter_mapping = {'extra_specs': _check_extra_specs_match} result = {} - for type_name, type_args in six.iteritems(share_types): + for type_name, type_args in share_types.items(): # go over all filters in the list - for opt, values in six.iteritems(search_opts): + for opt, values in search_opts.items(): try: filter_func = filter_mapping[opt] except KeyError: @@ -292,11 +292,11 @@ def share_types_diff(context, share_type_id1, share_type_id2): dict1 = {} if dict2 is None: dict2 = {} - for k, v in six.iteritems(dict1): + for k, v in dict1.items(): res[k] = (v, dict2.get(k)) if k not in dict2 or res[k][0] != res[k][1]: equal = False - for k, v in six.iteritems(dict2): + for k, v in dict2.items(): res[k] = (dict1.get(k), v) if k not in dict1 or res[k][0] != res[k][1]: equal = False diff --git a/manila/test.py b/manila/test.py index ef5e4cff97..e565dd2753 100644 --- a/manila/test.py +++ b/manila/test.py @@ -33,7 +33,6 @@ from oslo_config import fixture as config_fixture import oslo_i18n from oslo_messaging import conffixture as messaging_conffixture import oslotest.base as base_test -import six from manila.db import migration from manila.db.sqlalchemy import api as db_api @@ -171,7 +170,7 @@ class TestCase(base_test.BaseTestCase): def flags(self, **kw): """Override flag variables for a test.""" - for k, v in six.iteritems(kw): + for k, v in kw.items(): CONF.set_override(k, v) def start_service(self, name, host=None, **kwargs): diff --git a/manila/tests/api/fakes.py b/manila/tests/api/fakes.py index c5f49ab7b3..c371126a72 100644 --- a/manila/tests/api/fakes.py +++ b/manila/tests/api/fakes.py @@ -17,7 +17,6 @@ import uuid from oslo_utils import timeutils import routes -import six import webob import webob.dec import webob.request @@ -96,7 +95,7 @@ class FakeToken(object): def __init__(self, **kwargs): FakeToken.id_count += 1 self.id = FakeToken.id_count - for k, v in six.iteritems(kwargs): + for k, v in kwargs.items(): setattr(self, k, v) diff --git a/manila/tests/api/v2/test_share_types.py b/manila/tests/api/v2/test_share_types.py index 355846b615..935be0f468 100644 --- a/manila/tests/api/v2/test_share_types.py +++ b/manila/tests/api/v2/test_share_types.py @@ -18,7 +18,6 @@ import datetime import ddt import mock from oslo_utils import timeutils -import six import webob from manila.api.v2 import share_types as types @@ -406,7 +405,7 @@ def fake_share_type_get_all(context, inactive=False, filters=None): if filters is None or filters.get('is_public', None) is None: return SHARE_TYPES res = {} - for k, v in six.iteritems(SHARE_TYPES): + for k, v in SHARE_TYPES.items(): if filters['is_public'] and _has_type_access(k, context.project_id): res.update({k: v}) continue diff --git a/manila/tests/db/sqlalchemy/test_api.py b/manila/tests/db/sqlalchemy/test_api.py index b83b882b06..0644e4c5c8 100644 --- a/manila/tests/db/sqlalchemy/test_api.py +++ b/manila/tests/db/sqlalchemy/test_api.py @@ -859,8 +859,8 @@ class ShareNetworkDatabaseAPITestCase(BaseDatabaseAPITestCase): self.share_nw_dict['id']) self.assertEqual(new_name, result_update['name']) - self._check_fields(expected=dict(six.iteritems(result_update)), - actual=dict(six.iteritems(result_get))) + self._check_fields(expected=dict(result_update.items()), + actual=dict(result_get.items())) def test_update_not_found(self): self.assertRaises(exception.ShareNetworkNotFound, diff --git a/manila/tests/scheduler/fakes.py b/manila/tests/scheduler/fakes.py index 0a6884c30b..28e74ad84a 100644 --- a/manila/tests/scheduler/fakes.py +++ b/manila/tests/scheduler/fakes.py @@ -17,7 +17,6 @@ Fakes For Scheduler tests. """ from oslo_utils import timeutils -import six from manila.scheduler.drivers import filter from manila.scheduler import host_manager @@ -237,7 +236,7 @@ class FakeHostManager(host_manager.HostManager): class FakeHostState(host_manager.HostState): def __init__(self, host, attribute_dict): super(FakeHostState, self).__init__(host) - for (key, val) in six.iteritems(attribute_dict): + for (key, val) in attribute_dict.items(): setattr(self, key, val) diff --git a/manila/tests/share/drivers/glusterfs/test_layout_volume.py b/manila/tests/share/drivers/glusterfs/test_layout_volume.py index 2d527d72aa..23e01fcde9 100644 --- a/manila/tests/share/drivers/glusterfs/test_layout_volume.py +++ b/manila/tests/share/drivers/glusterfs/test_layout_volume.py @@ -23,7 +23,6 @@ import tempfile import ddt import mock from oslo_config import cfg -import six from manila.common import constants from manila import context @@ -185,7 +184,7 @@ class GlusterfsVolumeMappedLayoutTestCase(test.TestCase): self.mock_object(self._layout, '_glustermanager', mock.Mock(side_effect=_glustermanager_calls)) expected_output = {} - for q, d in six.iteritems(self.glusterfs_volumes_dict): + for q, d in self.glusterfs_volumes_dict.items(): if sharemark[q] not in (FAKE_UUID1, FAKE_UUID2): expected_output[q] = d diff --git a/manila/tests/share/drivers/netapp/dataontap/cluster_mode/test_driver_interfaces.py b/manila/tests/share/drivers/netapp/dataontap/cluster_mode/test_driver_interfaces.py index ebf6a9ff8a..adaae7f579 100644 --- a/manila/tests/share/drivers/netapp/dataontap/cluster_mode/test_driver_interfaces.py +++ b/manila/tests/share/drivers/netapp/dataontap/cluster_mode/test_driver_interfaces.py @@ -17,7 +17,6 @@ Mock unit tests for the NetApp file share driver interfaces import mock -import six from manila.share.drivers.netapp.dataontap.cluster_mode import drv_multi_svm from manila.share.drivers.netapp.dataontap.cluster_mode import drv_single_svm @@ -59,5 +58,5 @@ class NetAppFileStorageDriverInterfaceTestCase(test.TestCase): def _get_local_functions(self, obj): """Get function names of an object without superclass functions.""" - return set([key for key, value in six.iteritems(type(obj).__dict__) + return set([key for key, value in type(obj).__dict__.items() if callable(value)]) diff --git a/manila/tests/share/drivers/netapp/test_common.py b/manila/tests/share/drivers/netapp/test_common.py index ce250e4f69..2008ac78eb 100644 --- a/manila/tests/share/drivers/netapp/test_common.py +++ b/manila/tests/share/drivers/netapp/test_common.py @@ -116,7 +116,7 @@ class NetAppDriverFactoryTestCase(test.TestCase): registry = na_common.NETAPP_UNIFIED_DRIVER_REGISTRY for family in six.iterkeys(registry): - for mode, full_class_name in six.iteritems(registry[family]): + for mode, full_class_name in registry[family].items(): config = na_fakes.create_configuration() config.local_conf.set_override('driver_handles_share_servers', diff --git a/manila/tests/share/test_rpcapi.py b/manila/tests/share/test_rpcapi.py index 0683ad2ecb..6f24dac823 100644 --- a/manila/tests/share/test_rpcapi.py +++ b/manila/tests/share/test_rpcapi.py @@ -20,7 +20,6 @@ import copy from oslo_config import cfg from oslo_serialization import jsonutils -import six from manila.common import constants from manila import context @@ -132,7 +131,7 @@ class ShareRpcAPITestCase(test.TestCase): for arg, expected_arg in zip(self.fake_args, expected_args): self.assertEqual(expected_arg, arg) - for kwarg, value in six.iteritems(self.fake_kwargs): + for kwarg, value in self.fake_kwargs.items(): self.assertEqual(expected_msg[kwarg], value) def test_create_share_instance(self): diff --git a/manila/tests/test_wsgi.py b/manila/tests/test_wsgi.py index 0f9927290e..fdb31a6da0 100644 --- a/manila/tests/test_wsgi.py +++ b/manila/tests/test_wsgi.py @@ -273,7 +273,7 @@ class ExceptionTest(test.TestCase): self.assertEqual(exception_type.code, resp.status_int, resp.body) if hasattr(exception_type, 'headers'): - for (key, value) in six.iteritems(exception_type.headers): + for (key, value) in exception_type.headers.items(): self.assertTrue(key in resp.headers) self.assertEqual(value, resp.headers[key]) diff --git a/manila/wsgi.py b/manila/wsgi.py index f322463f43..1db0271f5f 100644 --- a/manila/wsgi.py +++ b/manila/wsgi.py @@ -35,7 +35,6 @@ from oslo_service import service from oslo_utils import excutils from paste import deploy import routes.middleware -import six import webob.dec import webob.exc @@ -440,7 +439,7 @@ class Debug(Middleware): resp = req.get_response(self.application) print(('*' * 40) + ' RESPONSE HEADERS') - for (key, value) in six.iteritems(resp.headers): + for (key, value) in resp.headers.items(): print(key, '=', value) print()