]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph: print output of "status" as string not as bytes 21297/head
authorKefu Chai <kchai@redhat.com>
Mon, 9 Apr 2018 08:53:42 +0000 (16:53 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 10 Apr 2018 05:31:13 +0000 (13:31 +0800)
in python3, the stuff read from wire is represented as "bytes", but
the output of "ceph -w" is supposed to be consumed by human. so decode
it as utf-8.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/ceph.in

index 0814b0bd1f9707c06f9edf690012d51f2c953761..8aeb9f48f2ac218c5f820ac9b8e01607346311c4 100755 (executable)
@@ -998,7 +998,7 @@ def main():
             # Filter on channel
             if (channel == parsed_args.watch_channel or \
                            parsed_args.watch_channel == "*"):
-                print(line)
+                print(line.decode('utf-8'))
                 sys.stdout.flush()
 
         # first do a ceph status
@@ -1006,7 +1006,7 @@ def main():
         if ret:
             print("status query failed: ", outs, file=sys.stderr)
             return ret
-        print(outbuf)
+        print(outbuf.decode('utf-8'))
 
         # this instance keeps the watch connection alive, but is
         # otherwise unused