diff options
author | Sage Weil <sage@inktank.com> | 2012-12-18 19:21:24 -0800 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2012-12-18 19:21:24 -0800 |
commit | 85763f09fe0ad1f295457fdfd5ac3c4b405821f4 (patch) | |
tree | 4e6a37e38a2ce1d2486213695acbd795ea08c8e9 | |
parent | 5f24e23b19df18bc6958595228f4bd37c88b24d7 (diff) | |
download | ceph-85763f09fe0ad1f295457fdfd5ac3c4b405821f4.tar.gz |
ceph: report error string to stderr, not stdout
If we return an error, send the message to stderr. This makes things
more easily scriptable because error messages won't take the place of
expected output.
Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r-- | src/tools/common.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/tools/common.cc b/src/tools/common.cc index 9679f08834e..9a3763a34ae 100644 --- a/src/tools/common.cc +++ b/src/tools/common.cc @@ -294,8 +294,12 @@ int do_command(CephToolCtx *ctx, << reply_from.name << " -> '" << reply_rs << "' (" << reply_rc << ")" << std::endl; - else - cout << reply_rs << std::endl; + else { + if (reply_rc >= 0) + cout << reply_rs << std::endl; + else + cerr << reply_rs << std::endl; + } return reply_rc; } |