From 359f456a7083f05e2b24ef36f31984f871eadb68 Mon Sep 17 00:00:00 2001 From: Dan Mick Date: Fri, 7 Jun 2013 16:39:34 -0700 Subject: [PATCH] ceph: old daemons output to outs and outbuf, combine When talking to old daemons, if a command succeeds, there may be output on outs, outbuf, or both; combine them if there's no error, and clear outs so it's not treated as stderr fodder. Signed-off-by: Dan Mick Reviewed-by: Sage Weil --- src/ceph.in | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ceph.in b/src/ceph.in index 74a76acfcb1..ad2df9ad35d 100755 --- a/src/ceph.in +++ b/src/ceph.in @@ -1426,7 +1426,8 @@ def main(): # try old mon ret, outbuf, outs = send_command(cmd=['status']) # old mon returns status to outs...ick - outbuf = outs + if ret == 0: + outbuf += outs if ret: print >> sys.stderr, "status query failed: ", outs return ret @@ -1487,6 +1488,11 @@ def main(): if verbose: print '{0} to old {1}'.format(' '.join(childargs), target[0]) ret, outbuf, outs = send_command(target, childargs, inbuf) + # combine nonerror outbuf and outs; either may have cmd output + if ret == 0: + outbuf += outs + # clear outs so generic code below doesn't print it to stderr + outs = '' elif ret: if ret < 0: ret = -ret