From 1d8c0438093af3f89e31d98f5608b0e2c56efca2 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Mon, 9 Apr 2018 16:53:42 +0800 Subject: [PATCH] ceph: print output of "status" as string not as bytes 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 --- src/ceph.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ceph.in b/src/ceph.in index 0814b0bd1f970..8aeb9f48f2ac2 100755 --- a/src/ceph.in +++ b/src/ceph.in @@ -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 -- 2.39.5