From: Sage Weil Date: Wed, 31 Jan 2018 22:19:34 +0000 (-0600) Subject: common/config: use cerr for --show-config-value X-Git-Tag: v13.0.2~78^2~35 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c2cd2e73514e98d7909ebf1710ccf325e41a07cf;p=ceph.git common/config: use cerr for --show-config-value Signed-off-by: Sage Weil --- diff --git a/src/common/config.cc b/src/common/config.cc index 8665707c9583..d0eefe66b5c0 100644 --- a/src/common/config.cc +++ b/src/common/config.cc @@ -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( diff --git a/src/common/config.h b/src/common/config.h index 7b90ad43be7d..684d7113daa8 100644 --- a/src/common/config.h +++ b/src/common/config.h @@ -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;