From d12d7a73ff6a1de482bcdb978e0fb7afd8cfe648 Mon Sep 17 00:00:00 2001 From: Chuck Short Date: Tue, 11 Jun 2013 13:22:56 -0500 Subject: 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 --- cinderclient/base.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cinderclient/base.py') 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: -- cgit v1.2.1