]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: improve error message when get pool option
authorChang Liu <liuchang0812@gmail.com>
Tue, 6 Mar 2018 11:44:30 +0000 (19:44 +0800)
committerChang Liu <liuchang0812@gmail.com>
Tue, 6 Mar 2018 11:44:30 +0000 (19:44 +0800)
Signed-off-by: Chang Liu <liuchang0812@gmail.com>
src/mon/OSDMonitor.cc

index 80644a77c1d98a27ae1471df487df872b4e11ba2..ba0549bc8519336ec5ece40c200691a5b95b6e45 100644 (file)
@@ -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);
     }