mirror of
https://github.com/ceph/ceph
synced 2025-01-19 01:21:49 +00:00
mgr: replace iteritems with six.iteritems (crash)
Fixes: http://tracker.ceph.com/issues/24779 Signed-off-by: Nathan Cutler <ncutler@suse.com>
This commit is contained in:
parent
ab001e1342
commit
9aa1d49583
@ -2,6 +2,7 @@ from mgr_module import MgrModule
|
||||
import datetime
|
||||
import errno
|
||||
import json
|
||||
import six
|
||||
|
||||
|
||||
DATEFMT = '%Y-%m-%d %H:%M:%S.%f'
|
||||
@ -82,7 +83,7 @@ class Module(MgrModule):
|
||||
|
||||
keeptime = datetime.timedelta(days=keep)
|
||||
|
||||
for key, meta in self.get_store_prefix('crash/').iteritems():
|
||||
for key, meta in six.iteritems(self.get_store_prefix('crash/')):
|
||||
meta = json.loads(meta)
|
||||
stamp = self.time_from_string(meta['timestamp'])
|
||||
if stamp <= now - keeptime:
|
||||
@ -116,7 +117,7 @@ class Module(MgrModule):
|
||||
'idlist': list()
|
||||
}
|
||||
|
||||
for key, meta in self.get_store_prefix('crash/').iteritems():
|
||||
for key, meta in six.iteritems(self.get_store_prefix('crash/')):
|
||||
total += 1
|
||||
meta = json.loads(meta)
|
||||
stamp = self.time_from_string(meta['timestamp'])
|
||||
|
Loading…
Reference in New Issue
Block a user