]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr/iostat: minor cleanups
authorKefu Chai <kchai@redhat.com>
Sun, 17 Jan 2021 02:19:53 +0000 (10:19 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 26 Jan 2021 10:01:59 +0000 (18:01 +0800)
* do not pass typename and self to super()
* do not add parentheses around condition expression

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/pybind/mgr/iostat/module.py

index 220bf928097b1c07dd646e09ad7e9c7693a1011a..5c18f5bf0a022bd63cae3f54df55203d63680b86 100644 (file)
@@ -3,7 +3,7 @@ from mgr_module import CLIReadCommand, HandleCommandResult, MgrModule
 
 class Module(MgrModule):
     def __init__(self, *args, **kwargs):
-        super(Module, self).__init__(*args, **kwargs)
+        super().__init__(*args, **kwargs)
 
     def self_test(self):
         r = self.get('io_rate')
@@ -31,7 +31,7 @@ class Module(MgrModule):
         r = self.get('io_rate')
 
         stamp_delta = int(float(r['pg_stats_delta']['stamp_delta']))
-        if (stamp_delta > 0):
+        if stamp_delta > 0:
             rd = r['pg_stats_delta']['stat_sum']['num_read_kb'] // stamp_delta
             wr = r['pg_stats_delta']['stat_sum']['num_write_kb'] // stamp_delta
             # The values are in kB, but to_pretty_iec() requires them to be in bytes