]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crushtool: print error message to stderr not dout(1) 18242/head
authorKefu Chai <kchai@redhat.com>
Wed, 11 Oct 2017 09:45:19 +0000 (17:45 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 11 Oct 2017 09:45:22 +0000 (17:45 +0800)
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 <kchai@redhat.com>
src/test/cli/crushtool/build.t
src/tools/crushtool.cc

index eadd96942811379a0af94d61de071d1a6443b377..4061d8fb4a43b27819bfb983e1496487179df9b1 100644 (file)
@@ -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:
index c2dbaae84fce2e32b0125a35c8a34072d4f74eec..7ecae9529ce9a3cf08ac265b948b58c4c1255538 100644 (file)
@@ -830,13 +830,14 @@ int main(int argc, const char **argv)
     {
       set<int> 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))