From a3e91cc5c99a88a82a3ca78a703f7ce39a512497 Mon Sep 17 00:00:00 2001 From: John Spray Date: Tue, 9 Oct 2018 07:27:44 -0400 Subject: [PATCH] ceph.in: reinstate interactive mode output This was broken in the following commit: """ commit 474c94b81efad1b954ab789bf8a97d93cd0e74f3 Author: Mohamad Gebai Date: Wed Feb 28 18:12:19 2018 -0500 ceph.in: handle polling commands Signed-off-by: Mohamad Gebai """ Fixes: http://tracker.ceph.com/issues/36358 Signed-off-by: John Spray --- src/ceph.in | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/ceph.in b/src/ceph.in index 23070e703bd..07461856917 100755 --- a/src/ceph.in +++ b/src/ceph.in @@ -625,7 +625,17 @@ def new_style_command(parsed_args, cmdargs, target, sigdict, inbuf, verbose): print('Can not use \'tell\' in interactive mode.', file=sys.stderr) continue - do_command(parsed_args, target, cmdargs, sigdict, inbuf, verbose) + ret, outbuf, outs = do_command(parsed_args, target, cmdargs, + sigdict, inbuf, verbose) + if ret < 0: + ret = -ret + errstr = errno.errorcode.get(ret, 'Unknown') + print(u'Error {0}: {1}'.format(errstr, outs), file=sys.stderr) + else: + if outs: + print(outs, file=sys.stderr) + if outbuf: + print(outbuf) return ret, outbuf, outs -- 2.39.5