From 921b24628cd4f587a5e86a2a823a12a59c836580 Mon Sep 17 00:00:00 2001 From: zhengyin Date: Wed, 6 Nov 2019 11:57:40 +0800 Subject: [PATCH] pybind/mgr: Cancel output color control 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 (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 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pybind/mgr/status/module.py b/src/pybind/mgr/status/module.py index acedbff906ab..a164c058565a 100644 --- a/src/pybind/mgr/status/module.py +++ b/src/pybind/mgr/status/module.py @@ -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)) -- 2.47.3