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

This change adds Python 3 compatibility to the modified code.

Replace also six.iteritems(obj) with obj.items().

The iteritems() method of Python 2 dictionaries was renamed to items()
on Python 3. As discussed on the openstack-dev mailing list, iteritems()
must be replaced with items(), six.iteritems() should not be used. In
OpenStack, the overhead of creating a temporary list with dict.items()
on Python 2 is negligible.

Blueprint cinder-python3
Change-Id: Ic3d8fd6b71d2c9f21929b0d6bf68c8f84a5e2567
This commit is contained in:
Victor Stinner
2015-06-12 14:53:05 +02:00
parent 28c52a82a2
commit 55eca11e07
55 changed files with 100 additions and 101 deletions

View File

@@ -338,7 +338,7 @@ class ConfigCommands(object):
if param:
print('%s = %s' % (param, CONF.get(param)))
else:
for key, value in CONF.iteritems():
for key, value in CONF.items():
print('%s = %s' % (key, value))