]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
common/config: fix rm_val error codes
authorSage Weil <sage@redhat.com>
Mon, 4 Jun 2018 15:59:51 +0000 (10:59 -0500)
committerSage Weil <sage@redhat.com>
Mon, 4 Jun 2018 16:07:45 +0000 (11:07 -0500)
EINVAL if the config option is invalid.
ENOENT if the config option wasn't set.

Signed-off-by: Sage Weil <sage@redhat.com>
src/common/config.cc

index d4649ae2fe8bea32ee60a267736997fd4ca5ea47..8becf6a42c00ee328be336040cb7d6fd226f0fa7 100644 (file)
@@ -1413,6 +1413,9 @@ void md_config_t::_refresh(const Option& opt)
 
 int md_config_t::_rm_val(const std::string& key, int level)
 {
+  if (schema.count(key) == 0) {
+    return -EINVAL;
+  }
   auto i = values.find(key);
   if (i == values.end()) {
     return -ENOENT;