]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
pybind/mgr: change format_bytes unit color from black to yellow
authorhaoyixing <haoyixing@kuaishou.com>
Fri, 8 Jan 2021 03:29:01 +0000 (11:29 +0800)
committerhaoyixing <haoyixing@kuaishou.com>
Fri, 8 Jan 2021 05:55:43 +0000 (13:55 +0800)
Currently format_bytes output (such as ceph fs status) makes unit black, which is
hard to distinguish on black terminals, so change them as same as the data itself.

Signed-off-by: haoyixing <haoyixing@kuaishou.com>
src/pybind/ceph_daemon.py
src/pybind/mgr/mgr_util.py

index 9b55613f5d9b090340783848c82b80a19295c545..b975c887ea9ce21daccfe3f31e61520a1a06c21e 100644 (file)
@@ -191,7 +191,7 @@ class DaemonWatcher(object):
         unit = 0
         while len("%s" % (int(n) // (1000**unit))) > width - 1:
             if unit >= len(units) - 1:
-                break;
+                break
             unit += 1
 
         if unit > 0:
@@ -208,7 +208,7 @@ class DaemonWatcher(object):
             else:
                 color = self.YELLOW, False
             return self.bold(self.colorize(formatted[0:-1], color[0], color[1])) \
-                + self.bold(self.colorize(formatted[-1], self.BLACK, False))
+                + self.bold(self.colorize(formatted[-1], self.YELLOW, False))
         else:
             return formatted
 
index 4513777970bb071675002359e53fc858ef9df5ef..1ae6992dc5cc6ddb4b9978052d3496327b34b702 100644 (file)
@@ -331,7 +331,7 @@ def format_units(n, width, colored, decimal):
         else:
             color = YELLOW, False
         return bold(colorize(formatted[0:-1], color[0], color[1])) \
-            + bold(colorize(formatted[-1], BLACK, False))
+            + bold(colorize(formatted[-1], YELLOW, False))
     else:
         return formatted