diff --git a/searchlightclient/common/base.py b/searchlightclient/common/base.py index 4162afc..50c1944 100644 --- a/searchlightclient/common/base.py +++ b/searchlightclient/common/base.py @@ -317,7 +317,7 @@ class CrudManager(BaseManager): def _filter_kwargs(self, kwargs): """Drop null values and handle ids.""" - for key, ref in six.iteritems(kwargs.copy()): + for key, ref in kwargs.copy().items(): if ref is None: kwargs.pop(key) else: @@ -476,7 +476,7 @@ class Resource(object): return None def _add_details(self, info): - for (k, v) in six.iteritems(info): + for (k, v) in info.items(): try: setattr(self, k, v) self._info[k] = v diff --git a/searchlightclient/common/exceptions.py b/searchlightclient/common/exceptions.py index 86d415b..0ea912e 100644 --- a/searchlightclient/common/exceptions.py +++ b/searchlightclient/common/exceptions.py @@ -423,7 +423,7 @@ class HttpVersionNotSupported(HttpServerError): # _code_map contains all the classes that have http_status attribute. _code_map = dict( (getattr(obj, 'http_status', None), obj) - for name, obj in six.iteritems(vars(sys.modules[__name__])) + for name, obj in vars(sys.modules[__name__]).items() if inspect.isclass(obj) and getattr(obj, 'http_status', False) ) diff --git a/searchlightclient/osc/v1/facet.py b/searchlightclient/osc/v1/facet.py index 9097528..d69f986 100644 --- a/searchlightclient/osc/v1/facet.py +++ b/searchlightclient/osc/v1/facet.py @@ -14,7 +14,6 @@ """Searchlight v1 Facet action implementations""" import logging -import six from osc_lib.command import command from osc_lib import utils @@ -63,7 +62,7 @@ class ListFacet(command.Lister): } data = search_client.facets.list(**params) result = [] - for resource_type, values in six.iteritems(data): + for resource_type, values in data.items(): if isinstance(values, list): # Cope with pre-1.0 service APIs facets = values diff --git a/searchlightclient/osc/v1/search.py b/searchlightclient/osc/v1/search.py index 639fa33..1ec3e7b 100644 --- a/searchlightclient/osc/v1/search.py +++ b/searchlightclient/osc/v1/search.py @@ -15,7 +15,6 @@ import json import logging -import six from osc_lib.command import command from osc_lib import utils @@ -118,7 +117,7 @@ class SearchResource(command.Lister): # hit._id may include extra information appended after _, # so use r['_source']['id'] for safe. r['_id'] = r.get('_source', {}).get('id') - for k, v in six.iteritems(r): + for k, v in r.items(): map_key = mapping.get(k) if map_key is not None: converted[map_key] = v diff --git a/searchlightclient/tests/unit/osc/fakes.py b/searchlightclient/tests/unit/osc/fakes.py index a5d4da8..5024c67 100644 --- a/searchlightclient/tests/unit/osc/fakes.py +++ b/searchlightclient/tests/unit/osc/fakes.py @@ -13,7 +13,6 @@ # under the License. # -import six import sys @@ -58,7 +57,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 __repr__(self): diff --git a/searchlightclient/v1/search.py b/searchlightclient/v1/search.py index 36b2335..8924f6b 100644 --- a/searchlightclient/v1/search.py +++ b/searchlightclient/v1/search.py @@ -10,8 +10,6 @@ # License for the specific language governing permissions and limitations # under the License. -import six - from searchlightclient.common import base @@ -43,7 +41,7 @@ class SearchManager(base.BaseManager): current project unless all_projects is set """ search_params = {} - for k, v in six.iteritems(kwargs): + for k, v in kwargs.items(): if k in ('query', 'type', 'offset', 'limit', 'sort', '_source', 'highlight', 'all_projects'): search_params[k] = v