From: Chang Liu Date: Tue, 6 Mar 2018 11:44:30 +0000 (+0800) Subject: mon: improve error message when get pool option X-Git-Tag: v13.0.2~34^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b4ba96fc95adf53ccb5a697db0eb2d36a1cf571e;p=ceph.git mon: improve error message when get pool option Signed-off-by: Chang Liu --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 80644a77c1d9..ba0549bc8519 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -4248,6 +4248,13 @@ bool OSDMonitor::preprocess_command(MonOpRequestRef op) goto reply; } + if (pool_opts_t::is_opt_name(var) && + !p->opts.is_set(pool_opts_t::get_opt_desc(var).key)) { + ss << "option '" << var << "' is not set on pool '" << poolstr << "'"; + r = -ENOENT; + goto reply; + } + selected_choices.insert(selected); }