Replace six.iteritems() with .items()

We should avoid using six.iteritems/keys achieve iterators. We can use
dict.items/keys instead, as it will return iterators in PY3 as well.
And dict.items/keys will more readable.

In py2, the performance about list should be negligible, see
https://wiki.openstack.org/wiki/Python3 and
http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html

Change-Id: I6353f0a1b423c6dbd0c71343f7919fd0de440e34
This commit is contained in:
Luong Anh Tuan 2016-11-22 11:46:40 +07:00 committed by Tuan Luong-Anh
parent 09cab0fa65
commit 29d50bc69b
1 changed files with 1 additions and 2 deletions

View File

@ -15,7 +15,6 @@
import os
import sys
import six
import yaml
@ -39,7 +38,7 @@ def merge_data(source, destination, distro):
result = dict()
result.update(destination)
family = os_family(distro)
for servicename, mapping in six.iteritems(source):
for servicename, mapping in source.items():
if servicename in result:
raise Exception("%s already found in services list" % servicename)
if distro in mapping: