From: Kefu Chai Date: Wed, 11 Oct 2017 09:45:19 +0000 (+0800) Subject: crushtool: print error message to stderr not dout(1) X-Git-Tag: v13.0.1~605^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F18242%2Fhead;p=ceph.git crushtool: print error message to stderr not dout(1) in hope to fix the mysterious test failure where cli/crushtool/build.t prints nothing when error message is expected. Fixes: http://tracker.ceph.com/issues/21758 Signed-off-by: Kefu Chai --- diff --git a/src/test/cli/crushtool/build.t b/src/test/cli/crushtool/build.t index eadd96942811..4061d8fb4a43 100644 --- a/src/test/cli/crushtool/build.t +++ b/src/test/cli/crushtool/build.t @@ -14,7 +14,7 @@ # display a warning if there is more than one root # $ crushtool --outfn "$map" --build --num_osds 5 node straw 2 rack straw 1 - .* The crush rulesets will use the root rack0 (re) + The crush rulesets will use the root rack0 (re) and ignore the others. There are 3 roots, they can be grouped into a single root by appending something like: diff --git a/src/tools/crushtool.cc b/src/tools/crushtool.cc index c2dbaae84fce..7ecae9529ce9 100644 --- a/src/tools/crushtool.cc +++ b/src/tools/crushtool.cc @@ -830,13 +830,14 @@ int main(int argc, const char **argv) { set roots; crush.find_roots(&roots); - if (roots.size() > 1) - dout(1) << "The crush rulesets will use the root " << root << "\n" - << "and ignore the others.\n" - << "There are " << roots.size() << " roots, they can be\n" - << "grouped into a single root by appending something like:\n" - << " root straw 0\n" - << dendl; + if (roots.size() > 1) { + cerr << "The crush rulesets will use the root " << root << "\n" + << "and ignore the others.\n" + << "There are " << roots.size() << " roots, they can be\n" + << "grouped into a single root by appending something like:\n" + << " root straw 0\n" + << std::endl; + } } if (OSDMap::build_simple_crush_rules(g_ceph_context, crush, root, &cerr))