From b4ba96fc95adf53ccb5a697db0eb2d36a1cf571e Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Tue, 6 Mar 2018 19:44:30 +0800 Subject: [PATCH] mon: improve error message when get pool option Signed-off-by: Chang Liu --- src/mon/OSDMonitor.cc | 7 +++++++ 1 file changed, 7 insertions(+) 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); } -- 2.47.3