summaryrefslogtreecommitdiff
path: root/cinderclient/base.py
diff options
context:
space:
mode:
authorChuck Short <chuck.short@canonical.com>2013-06-11 13:22:56 -0500
committerChuck Short <chuck.short@canonical.com>2013-06-11 13:29:13 -0500
commitd12d7a73ff6a1de482bcdb978e0fb7afd8cfe648 (patch)
treee2db49263b8559fac321ee5b23b3bbdc69d9c22f /cinderclient/base.py
parent93557c1929f9cdbd229fc3f11236c694e8abdee3 (diff)
downloadpython-cinderclient-d12d7a73ff6a1de482bcdb978e0fb7afd8cfe648.tar.gz
python3: compatibility for iteritems and iterkeys
Use six to allow python2/pyton3 for iteritems and iterkeys. six.iteriems() replaces dictionary.iteritems() (python2) and dictionary.iterms() (python3) six.iterkeys() replaces dictionary.iterkeys (python2) and dictionary.keys() (python3) Change-Id: I26c80b78a7dedf3aa32eedf01a83ff6d1e592ba7 Signed-off-by: Chuck Short <chuck.short@canonical.com>
Diffstat (limited to 'cinderclient/base.py')
-rw-r--r--cinderclient/base.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/cinderclient/base.py b/cinderclient/base.py
index 6024f59..7577773 100644
--- a/cinderclient/base.py
+++ b/cinderclient/base.py
@@ -22,6 +22,9 @@ import abc
import contextlib
import hashlib
import os
+
+import six
+
from cinderclient import exceptions
from cinderclient import utils
@@ -248,7 +251,7 @@ class Resource(object):
return None
def _add_details(self, info):
- for (k, v) in info.iteritems():
+ for (k, v) in six.iteritems(info):
try:
setattr(self, k, v)
except AttributeError: