]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/config: use cerr for --show-config-value
authorSage Weil <sage@redhat.com>
Wed, 31 Jan 2018 22:19:34 +0000 (16:19 -0600)
committerSage Weil <sage@redhat.com>
Tue, 6 Mar 2018 20:44:50 +0000 (14:44 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
src/common/config.cc
src/common/config.h

index 8665707c9583c6a7123c5f340314413811cc704d..d0eefe66b5c0ad73d220abff09c1e25dd0ed8c1e 100644 (file)
@@ -611,7 +611,7 @@ void md_config_t::do_argv_commands()
 
   if (do_show_config_value.size()) {
     string val;
-    int r = conf_stringify(_get_val(do_show_config_value), &val);
+    int r = conf_stringify(_get_val(do_show_config_value, 0, &cerr), &val);
     if (r < 0) {
       if (r == -ENOENT)
        std::cerr << "failed to get config option '"
@@ -981,7 +981,8 @@ Option::value_t md_config_t::get_val_generic(const std::string &key) const
 
 Option::value_t md_config_t::_get_val(
   const std::string &key,
-  expand_stack_t *stack) const
+  expand_stack_t *stack,
+  std::ostream *err) const
 {
   assert(lock.is_locked());
   if (key.empty()) {
@@ -997,7 +998,7 @@ Option::value_t md_config_t::_get_val(
     return Option::value_t(boost::blank());
   }
 
-  return _get_val(*o, stack);
+  return _get_val(*o, stack, err);
 }
 
 Option::value_t md_config_t::_get_val(
index 7b90ad43be7d291df3d5805fe4e112f7aad91713..684d7113daa8b93d0ad566f9b5d21d18c2490a46 100644 (file)
@@ -247,7 +247,8 @@ private:
 
   int _get_val_cstr(const std::string &key, char **buf, int len) const;
   Option::value_t _get_val(const std::string &key,
-                          expand_stack_t *stack=0) const;
+                          expand_stack_t *stack=0,
+                          std::ostream *err=0) const;
   Option::value_t _get_val(const Option& o,
                           expand_stack_t *stack=0,
                           std::ostream *err=0) const;