From: Kefu Chai Date: Sun, 17 Jan 2021 02:41:58 +0000 (+0800) Subject: pybind/mgr/insights: be PEP8 compliant X-Git-Tag: v17.1.0~3164^2~18 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=dee84744745fe9084b7f76a134df9b991bc5dce5;p=ceph.git pybind/mgr/insights: be PEP8 compliant to applease flake8 Signed-off-by: Kefu Chai --- diff --git a/src/pybind/mgr/insights/module.py b/src/pybind/mgr/insights/module.py index ac082b69a17a..3566ffb78a6b 100644 --- a/src/pybind/mgr/insights/module.py +++ b/src/pybind/mgr/insights/module.py @@ -158,20 +158,20 @@ class Module(MgrModule): "major": m.group("major"), "minor": m.group("minor") } - return { k:int(v) for k,v in ver.items() } + return {k: int(v) for k, v in ver.items()} def _crash_history(self, hours): """ Load crash history for the past N hours from the crash module. """ params = dict( - prefix = "crash json_report", - hours = hours + prefix="crash json_report", + hours=hours ) result = dict( - summary = {}, - hours = params["hours"], + summary={}, + hours=params["hours"], ) health_check_details = [] @@ -299,9 +299,6 @@ class Module(MgrModule): the selftest module to manage testing scenarios related to tracking health history. """ - try: - hours = long(hours) - except NameError: - hours = int(hours) - health_util.NOW_OFFSET = datetime.timedelta(hours = hours) + hours = int(hours) + health_util.NOW_OFFSET = datetime.timedelta(hours=hours) self.log.warning("Setting now time offset {}".format(health_util.NOW_OFFSET))