diff options
author | Chang Bo Guo <guochbo@cn.ibm.com> | 2013-11-28 02:38:03 -0800 |
---|---|---|
committer | Chang Bo Guo <guochbo@cn.ibm.com> | 2013-11-28 02:38:03 -0800 |
commit | fe8726422b3f7f95ccdf3eaca0472980c073aeb5 (patch) | |
tree | 7ec2412b817091e4b6e99b80a22e4f21d49df32b | |
parent | 1bd02bdcd8c023bd8d72a2349021126f95153beb (diff) | |
download | oslo-middleware-fe8726422b3f7f95ccdf3eaca0472980c073aeb5.tar.gz |
Use six.iteritems to make dict work on Python2/3
six.iteritems returns an iterator over dictionary‘s items.
This replaces dictionary.iteritems() on Python 2 and dictionary.items()
on Python 3. See http://pythonhosted.org/six/#six.iteritems
Implements: blueprint make-python3-compatible
Change-Id: I90be87979ebc7eccd11d66cd1eef16d9b2eb9fda
-rw-r--r-- | openstack/common/middleware/debug.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/openstack/common/middleware/debug.py b/openstack/common/middleware/debug.py index c8538c7..abe414e 100644 --- a/openstack/common/middleware/debug.py +++ b/openstack/common/middleware/debug.py @@ -19,6 +19,7 @@ from __future__ import print_function import sys +import six import webob.dec from openstack.common.middleware import base @@ -40,7 +41,7 @@ class Debug(base.Middleware): resp = req.get_response(self.application) print(("*" * 40) + " RESPONSE HEADERS") - for (key, value) in resp.headers.iteritems(): + for (key, value) in six.iteritems(resp.headers): print(key, "=", value) print() |