From: Nathan Cutler Date: Thu, 5 Jul 2018 15:22:16 +0000 (+0200) Subject: mgr: replace iteritems with six.iteritems (restful) X-Git-Tag: v13.2.1~87^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=346ca540be680ce442deef6c1dcf4f3dccfff76e;p=ceph.git mgr: replace iteritems with six.iteritems (restful) Fixes: http://tracker.ceph.com/issues/24779 Signed-off-by: Nathan Cutler (cherry picked from commit c02c6601755efbe5fb06021d314d5b2d8aa6c79e) --- diff --git a/src/pybind/mgr/restful/module.py b/src/pybind/mgr/restful/module.py index 8856987cd37a..9d07d303afba 100644 --- a/src/pybind/mgr/restful/module.py +++ b/src/pybind/mgr/restful/module.py @@ -11,6 +11,7 @@ import inspect import tempfile import threading import traceback +import six import socket from . import common @@ -26,12 +27,6 @@ from .hooks import ErrorHook from mgr_module import MgrModule, CommandResult -try: - iteritems = dict.iteritems -except: - iteritems = dict.items - - class CannotServe(Exception): pass @@ -270,7 +265,7 @@ class Module(MgrModule): def refresh_keys(self): self.keys = {} rawkeys = self.get_store_prefix('keys/') or {} - for k, v in iteritems(rawkeys): + for k, v in six.iteritems(rawkeys): self.keys[k[5:]] = v # strip of keys/ prefix def _serve(self):