From: Kefu Chai Date: Mon, 9 Apr 2018 08:53:42 +0000 (+0800) Subject: ceph: print output of "status" as string not as bytes X-Git-Tag: v13.1.0~319^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F21297%2Fhead;p=ceph.git 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 --- diff --git a/src/ceph.in b/src/ceph.in index 0814b0bd1f97..8aeb9f48f2ac 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