From 6bdb280954bda42cc8de37165a368cc30450f858 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sun, 28 Jun 2020 20:52:25 +0800 Subject: [PATCH] pybind/mgr/insights: drop py2 support Signed-off-by: Kefu Chai --- src/pybind/mgr/insights/health.py | 3 +-- src/pybind/mgr/insights/module.py | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/pybind/mgr/insights/health.py b/src/pybind/mgr/insights/health.py index 5235ca849c1a2..48e5c37f41b89 100644 --- a/src/pybind/mgr/insights/health.py +++ b/src/pybind/mgr/insights/health.py @@ -1,5 +1,4 @@ import json -import six from collections import defaultdict import datetime @@ -44,7 +43,7 @@ class HealthCheckAccumulator(object): """ changed = False - for check, info in six.iteritems(checks): + for check, info in checks.items(): # only keep the icky stuff severity = info["severity"] diff --git a/src/pybind/mgr/insights/module.py b/src/pybind/mgr/insights/module.py index a640d85b74691..001bfb62061ac 100644 --- a/src/pybind/mgr/insights/module.py +++ b/src/pybind/mgr/insights/module.py @@ -2,7 +2,7 @@ import datetime import json import re import threading -import six + from mgr_module import MgrModule, CommandResult from . import health as health_util @@ -121,7 +121,7 @@ class Module(MgrModule): """Filter hourly health reports timestamp""" matches = filter( lambda t: f(health_util.HealthHistorySlot.key_to_time(t[0])), - six.iteritems(self.get_store_prefix(health_util.HEALTH_HISTORY_KEY_PREFIX))) + self.get_store_prefix(health_util.HEALTH_HISTORY_KEY_PREFIX).items()) return map(lambda t: t[0], matches) def _health_prune_history(self, hours): @@ -171,7 +171,7 @@ class Module(MgrModule): "major": m.group("major"), "minor": m.group("minor") } - return { k:int(v) for k,v in six.iteritems(ver) } + return { k:int(v) for k,v in ver.items() } def _crash_history(self, hours): """ -- 2.39.5