]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph.in: Re-enable ceph interactive mode (missing its output). 487/head
authorDan Mick <dan.mick@inktank.com>
Tue, 6 Aug 2013 01:18:59 +0000 (18:18 -0700)
committerDan Mick <dan.mick@inktank.com>
Thu, 8 Aug 2013 16:38:04 +0000 (09:38 -0700)
Also, loop on error.  There's no reason to exit the interpreter loop on
an error, and it's probably less annoying if we don't.  Print the error,
and any output, and continue.

Fixes: #5746
Signed-off-by: Dan Mick <dan.mick@inktank.com>
src/ceph.in

index 4dd9dfc37ae398f82f84a6937db75b47e53a0d35..102796dcf6bfa9648e01f8245434413667c566ab 100755 (executable)
@@ -396,10 +396,15 @@ def new_style_command(parsed_args, cmdargs, target, sigdict, inbuf, verbose):
                                                      target=target,
                                                      argdict=valid_dict)
                     if ret:
-                        sys.stderr.write('Error {0}: {1}'.format(ret, outs))
-                        return ret, '', outs
+                        ret = abs(ret)
+                        print >> sys.stderr, \
+                            'Error: {0} {1}'.format(ret, errno.errorcode[ret])
+                    if outbuf:
+                        print outbuf
+                    if outs:
+                        print >> sys.stderr, 'Status:\n', outs
                 else:
-                    print "invalid command"
+                    print >> sys.stderr, "Invalid command"
 
     if verbose:
         print >> sys.stderr, "Submitting command ", valid_dict