From 29d50bc69b95f3bcb834cae9dff73fcf170d2654 Mon Sep 17 00:00:00 2001 From: Luong Anh Tuan Date: Tue, 22 Nov 2016 11:46:40 +0700 Subject: [PATCH] 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 --- elements/svc-map/extra-data.d/10-merge-svc-map-files | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/elements/svc-map/extra-data.d/10-merge-svc-map-files b/elements/svc-map/extra-data.d/10-merge-svc-map-files index 3aa1afe2..c8b0e034 100755 --- a/elements/svc-map/extra-data.d/10-merge-svc-map-files +++ b/elements/svc-map/extra-data.d/10-merge-svc-map-files @@ -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: