]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph.in: reinstate interactive mode output 24971/head
authorJohn Spray <john.spray@redhat.com>
Tue, 9 Oct 2018 11:27:44 +0000 (07:27 -0400)
committerNathan Cutler <ncutler@suse.com>
Wed, 7 Nov 2018 11:44:29 +0000 (12:44 +0100)
This was broken in the following commit:
"""
commit 474c94b81efad1b954ab789bf8a97d93cd0e74f3
Author: Mohamad Gebai <mgebai@suse.com>
Date:   Wed Feb 28 18:12:19 2018 -0500

ceph.in: handle polling commands

Signed-off-by: Mohamad Gebai <mgebai@suse.com>
"""

Fixes: http://tracker.ceph.com/issues/36358
Signed-off-by: John Spray <john.spray@redhat.com>
(cherry picked from commit a3e91cc5c99a88a82a3ca78a703f7ce39a512497)

src/ceph.in

index c37ce6d846b187ad6aaa5d64ca499d8c93fc4472..6d0b6e7d97f8c2290f4f256c2168dafc8bbe4eac 100755 (executable)
@@ -618,7 +618,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