Merge "Replace six.iteritems() with .items()"

This commit is contained in:
Jenkins 2017-07-30 23:44:21 +00:00 committed by Gerrit Code Review
commit efbf012a4b
4 changed files with 5 additions and 6 deletions

View File

@ -303,7 +303,7 @@ class CrudManager(BaseManager):
def _filter_kwargs(self, kwargs): def _filter_kwargs(self, kwargs):
"""Drop null values and handle ids.""" """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: if ref is None:
kwargs.pop(key) kwargs.pop(key)
else: else:
@ -461,7 +461,7 @@ class Resource(object):
return None return None
def _add_details(self, info): def _add_details(self, info):
for (k, v) in six.iteritems(info): for (k, v) in info.items():
try: try:
setattr(self, k, v) setattr(self, k, v)
self._info[k] = v self._info[k] = v

View File

@ -421,7 +421,7 @@ class HttpVersionNotSupported(HttpServerError):
# _code_map contains all the classes that have http_status attribute. # _code_map contains all the classes that have http_status attribute.
_code_map = dict( _code_map = dict(
(getattr(obj, 'http_status', None), obj) (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) if inspect.isclass(obj) and getattr(obj, 'http_status', False)
) )

View File

@ -195,7 +195,7 @@ def print_dict(dct, dict_property="Property", wrap=0):
""" """
pt = prettytable.PrettyTable([dict_property, 'Value']) pt = prettytable.PrettyTable([dict_property, 'Value'])
pt.align = 'l' pt.align = 'l'
for k, v in six.iteritems(dct): for k, v in dct.items():
# convert dict to str to check length # convert dict to str to check length
if isinstance(v, dict): if isinstance(v, dict):
v = six.text_type(v) v = six.text_type(v)

View File

@ -16,7 +16,6 @@ from keystoneclient import adapter
from keystoneclient import client as ks_client from keystoneclient import client as ks_client
from keystoneclient import discover from keystoneclient import discover
from keystoneclient import session from keystoneclient import session
import six
from distilclient.common import httpclient from distilclient.common import httpclient
from distilclient import exceptions from distilclient import exceptions
@ -109,7 +108,7 @@ class Client(object):
'api_key': 'password', 'api_key': 'password',
} }
for arg, replacement in six.iteritems(deprecated): for arg, replacement in deprecated.items():
if kwargs.get(arg, None) is None: if kwargs.get(arg, None) is None:
continue continue