]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cephfs-shell: Use colorama module instead of colorize
authorVarsha Rao <varao@redhat.com>
Mon, 8 Apr 2019 07:38:12 +0000 (13:08 +0530)
committerVarsha Rao <varao@redhat.com>
Mon, 8 Apr 2019 07:59:16 +0000 (13:29 +0530)
Remove references to colorize attributes. As in cmd2 module, colorize attribute
is deleted. Instead use colorama module.

Fixes: https://tracker.ceph.com/issues/38996
Signed-off-by: Varsha Rao <varao@redhat.com>
src/tools/cephfs/cephfs-shell

index 88e45f1aacfda420d3bc54c3c0ce0b9cc1934d79..23ef9789bb15faf8f1f9ab3be8439241edfa6dc9 100755 (executable)
@@ -168,7 +168,7 @@ def print_long(shell, file_name, is_dir, human_readable):
     info = cephfs.stat(file_name)
     file_name = os.path.basename(file_name.decode('utf-8'))
     if is_dir:
-        file_name = shell.colorize(file_name+'/',  'blue')
+        file_name = colorama.Style.BRIGHT + colorama.Fore.CYAN + file_name + '/' + colorama.Style.RESET_ALL
     if human_readable:
         shell.poutput('{}\t{:10s} {} {} {} {}'.format(
             mode_notation(info.st_mode),
@@ -590,7 +590,7 @@ exists.')
                     print_long(self, cephfs.getcwd().decode(
                         'utf-8') + dir_name + '/' + path, is_dir, False)
                 elif is_dir:
-                    values.append(self.colorize(path + '/', 'blue'))
+                    values.append(colorama.Style.BRIGHT + colorama.Fore.CYAN + path + '/')
                 else:
                     values.append(path)
             if not args.long: