diff options
author | gengchc2 <geng.changcai2@zte.com.cn> | 2016-12-09 11:04:16 +0800 |
---|---|---|
committer | gengchc2 <geng.changcai2@zte.com.cn> | 2016-12-09 11:04:16 +0800 |
commit | 56bb3dae5ff2a3a51e54d8fa42277602e7b50710 (patch) | |
tree | 73f8a5aa34a5d3d146da1acd46ef919680ed7075 /novaclient/base.py | |
parent | e490688b119786d8e59d6b72248d2484c032f761 (diff) | |
download | python-novaclient-56bb3dae5ff2a3a51e54d8fa42277602e7b50710.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: I6289f46344876d19d9a6793875f896cedc85a01c
Diffstat (limited to 'novaclient/base.py')
-rw-r--r-- | novaclient/base.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/novaclient/base.py b/novaclient/base.py index 6e9fdcdf..a091f0b6 100644 --- a/novaclient/base.py +++ b/novaclient/base.py @@ -162,7 +162,7 @@ class Resource(RequestIdMixin): return None def _add_details(self, info): - for (k, v) in six.iteritems(info): + for (k, v) in info.items(): try: setattr(self, k, v) self._info[k] = v @@ -488,7 +488,7 @@ class BootingManagerWithFind(ManagerWithFind): bdm = [] - for device_name, mapping in six.iteritems(block_device_mapping): + for device_name, mapping in block_device_mapping.items(): # # The mapping is in the format: # <id>:[<type>]:[<size(GB)>]:[<delete_on_terminate>] |