summaryrefslogtreecommitdiff
path: root/heatclient/tests
diff options
context:
space:
mode:
authorM V P Nitesh <m.nitesh@nectechnologies.in>2017-03-31 15:15:17 +0530
committerM V P Nitesh <m.nitesh@nectechnologies.in>2017-03-31 15:16:54 +0530
commit61aa092ce5cdee495e6faf63c36419e5583d3627 (patch)
treedb02760894ea1da0f1489197470acad35d919b7c /heatclient/tests
parent954e475a6a0a12432ec325d7579460fabcf3f40a (diff)
downloadpython-heatclient-61aa092ce5cdee495e6faf63c36419e5583d3627.tar.gz
Replace six.iteritems() with .items()
1.As mentioned in [1], we should avoid using six.iteritems to achieve iterators. We can use dict.items instead, as it will return iterators in PY3 as well. And dict.items/keys will more readable. 2.In py2, the performance about list should be negligible, see the link [2]. [1] https://wiki.openstack.org/wiki/Python3 [2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html Change-Id: I3913e8876b34e112140788d7a405da6eedfb5f29
Diffstat (limited to 'heatclient/tests')
-rw-r--r--heatclient/tests/functional/osc/v1/base.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/heatclient/tests/functional/osc/v1/base.py b/heatclient/tests/functional/osc/v1/base.py
index 31a9cd7..b17fb4c 100644
--- a/heatclient/tests/functional/osc/v1/base.py
+++ b/heatclient/tests/functional/osc/v1/base.py
@@ -48,7 +48,7 @@ class OpenStackClientTestBase(base.ClientTestBase):
items = self.parser.listing(output)
for item in items:
obj[item['Field']] = six.text_type(item['Value'])
- return dict((self._key_name(k), v) for k, v in six.iteritems(obj))
+ return dict((self._key_name(k), v) for k, v in obj.items())
def _key_name(self, key):
return key.lower().replace(' ', '_')
@@ -60,7 +60,7 @@ class OpenStackClientTestBase(base.ClientTestBase):
if item['ID'] == id:
obj = item
break
- return dict((self._key_name(k), v) for k, v in six.iteritems(obj))
+ return dict((self._key_name(k), v) for k, v in obj.items())
def _stack_create(self, name, template, parameters=[], wait=True):
cmd = 'stack create ' + name