From: Bassam Tabbara Date: Mon, 17 Oct 2016 21:36:00 +0000 (-0700) Subject: mon: if crushtool config is empty use internal crush test X-Git-Tag: v11.1.0~259^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F11765%2Fhead;p=ceph.git mon: if crushtool config is empty use internal crush test 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 --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index ef0d87a9be4..fb8231cbf3b 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -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;