]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr/insights: be PEP8 compliant
authorKefu Chai <kchai@redhat.com>
Sun, 17 Jan 2021 02:41:58 +0000 (10:41 +0800)
committerSebastian Wagner <sebastian.wagner@suse.com>
Fri, 29 Jan 2021 12:42:38 +0000 (13:42 +0100)
to applease flake8

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit dee84744745fe9084b7f76a134df9b991bc5dce5)

src/pybind/mgr/insights/module.py

index ac082b69a17a6af3837caabeac6609c08c380fde..3566ffb78a6b0b48a408554bacd6653f13ba94bf 100644 (file)
@@ -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))