Replace six.iteritems(dict) with dict.items()

Replacing dict.iteritems()/.itervalues() with
six.iteritems(dict)/six.itervalues(dict) was preferred in the past
but there was a discussion suggesting to avoid six for this.
ref:
http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html

Change-Id: Id17494887e241b1f0e0195ab8817d07581f51a96
This commit is contained in:
ting.wang 2016-01-16 10:13:48 +08:00 committed by binean
parent 5bc61159c2
commit 1f1f02aac6
2 changed files with 3 additions and 4 deletions

View File

@ -36,7 +36,7 @@ def fields(d, names, pred=lambda x: True,
"""
return dict((key_transform(k), value_transform(v))
for k, v in six.iteritems(d)
for k, v in d.items()
if k in names and pred(v))
@ -62,7 +62,7 @@ def dict_to_conf(options):
opts = []
for k, v in six.iteritems(options):
for k, v in options.items():
opt_type = _pytype_to_cfgtype[type(v)]
opts.append(opt_type(name=k, default=v))

View File

@ -18,7 +18,6 @@ import os
import fixtures
from oslo_config import cfg
from oslo_log import log
import six
import testtools
from zaqar.common import configs
@ -100,7 +99,7 @@ class TestBase(testtools.TestCase):
All overrides are automatically cleared at the end of the current
test by the tearDown() method.
"""
for k, v in six.iteritems(kw):
for k, v in kw.items():
self.conf.set_override(k, v, group, enforce_type=True)
def _my_dir(self):