]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr: Cancel output color control 31696/head
authorzhengyin <zhengyin@cmss.chinamobile.com>
Wed, 6 Nov 2019 03:57:40 +0000 (11:57 +0800)
committerKonstantin Shalygin <k0ste@k0ste.ru>
Mon, 18 Nov 2019 03:24:17 +0000 (10:24 +0700)
When I do "ceph osd status" command, the units are not visible
when using a black background, So cancel outpul color control

Fixes: https://tracker.ceph.com/issues/42517
Signed-off-by: Zheng Yin <zhengyin@cmss.chinamobile.com>
(cherry picked from commit ca2675e215acc8fbfb2d730b9c1f9f3aafc3e67d)

Conflicts:
- path: rc/pybind/mgr/mgr_util.py
  comment: mgr_util.py in luminous is status/module.py

src/pybind/mgr/status/module.py

index acedbff906ab7f2906e2b7b41d61cbd1779e12cb..a164c058565ad5f96f1c79e49e2226b6f4d73061 100644 (file)
@@ -63,10 +63,10 @@ class Module(MgrModule):
         """
         Format a number without units, so as to fit into `width` characters, substituting
         an appropriate unit suffix.
-        
+
         Use decimal for dimensionless things, use base 2 (decimal=False) for byte sizes/rates.
         """
-        
+
         factor = 1000 if decimal else 1024
         units = [' ', 'k', 'M', 'G', 'T', 'P']
         unit = 0
@@ -91,12 +91,12 @@ class Module(MgrModule):
         else:
             return formatted
 
-    def format_dimless(self, n, width, colored=True):
+    def format_dimless(self, n, width, colored=False):
         return self.format_units(n, width, colored, decimal=True)
-    
-    def format_bytes(self, n, width, colored=True):
+
+    def format_bytes(self, n, width, colored=False):
         return self.format_units(n, width, colored, decimal=False)
-        
+
     def get_latest(self, daemon_type, daemon_name, stat):
         data = self.get_counter(daemon_type, daemon_name, stat)[stat]
         #self.log.error("get_latest {0} data={1}".format(stat, data))