summaryrefslogtreecommitdiff
path: root/keystoneclient/session.py
diff options
context:
space:
mode:
authorM V P Nitesh <m.nitesh@nectechnologies.in>2017-04-03 18:20:15 +0530
committerM V P Nitesh <m.nitesh@nectechnologies.in>2017-04-03 18:20:52 +0530
commit46b9e429a2cbfcd1d898616c177538a9283997d3 (patch)
treed26fc8b13a0b0276c2ee7d9d7c6a7b154d6ac186 /keystoneclient/session.py
parentcfd33730868350cd475e45569a8c1573803a6895 (diff)
downloadpython-keystoneclient-46b9e429a2cbfcd1d898616c177538a9283997d3.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: I18a6890935ebdbb589269379f21a0dd47d07eb3a
Diffstat (limited to 'keystoneclient/session.py')
-rw-r--r--keystoneclient/session.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/keystoneclient/session.py b/keystoneclient/session.py
index 17b1d7f..bb284bd 100644
--- a/keystoneclient/session.py
+++ b/keystoneclient/session.py
@@ -201,7 +201,7 @@ class Session(object):
string_parts.append(url)
if headers:
- for header in six.iteritems(headers):
+ for header in headers.items():
string_parts.append('-H "%s: %s"'
% self._process_header(header))
@@ -249,7 +249,7 @@ class Session(object):
'RESP:',
'[%s]' % response.status_code
]
- for header in six.iteritems(response.headers):
+ for header in response.headers.items():
string_parts.append('%s: %s' % self._process_header(header))
string_parts.append('\nRESP BODY: %s\n' % strutils.mask_password(text))