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>
_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;