]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: if crushtool config is empty use internal crush test 11765/head
authorBassam Tabbara <bassam.tabbara@quantum.com>
Mon, 17 Oct 2016 21:36:00 +0000 (14:36 -0700)
committerBassam Tabbara <bassam.tabbara@quantum.com>
Thu, 3 Nov 2016 14:09:04 +0000 (07:09 -0700)
currently we expect the tool ```crushtool``` to be installed and
available for crush map testing. This is not always the case. The
change here will use the internal crush tester if the ```crushtool```
config is empty.

Signed-off-by: Bassam Tabbara <bassam.tabbara@quantum.com>
src/mon/OSDMonitor.cc

index ef0d87a9be4e3b9a2e1acfe7fc48ecdc293f330d..fb8231cbf3bc4533793174b43308cd37157436a0 100644 (file)
@@ -4943,10 +4943,15 @@ int OSDMonitor::prepare_new_pool(string& name, uint64_t auid,
   _get_pending_crush(newcrush);
   ostringstream err;
   CrushTester tester(newcrush, err);
-  r = tester.test_with_crushtool(g_conf->crushtool.c_str(),
+  // use the internal crush tester if crushtool config is empty
+  if (g_conf->crushtool.empty()) {
+    r = tester.test();
+  } else {
+    r = tester.test_with_crushtool(g_conf->crushtool.c_str(),
                                 osdmap.get_max_osd(),
                                 g_conf->mon_lease,
                                 crush_ruleset);
+  }
   if (r) {
     dout(10) << " tester.test_with_crushtool returns " << r
             << ": " << err.str() << dendl;