From: Kefu Chai Date: Fri, 13 Jul 2018 09:25:41 +0000 (+0800) Subject: rbd-ggate: filter out ceph options from args X-Git-Tag: v14.0.1~882^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0bf02e8fe5671dd847f332953732fa47f5888694;p=ceph.git rbd-ggate: filter out ceph options from args we can just filter out ceph options from command line args instead of parsing config in env variables, conf files and argvs. the config-parsing steps were modeled after the ones in rbd-nbd.cc, but the whole purpose of reading configurations from env/conf-file is to get the "rbd_default_pool" for setting cfg->poolname. apparently, this does not apply to rbd-ggate, where global_init() will take care of all the trivial work to populate the settings. moreover, `config` is not read after being initialized in main.cc. so drop it. Signed-off-by: Mykola Golub Signed-off-by: Kefu Chai --- diff --git a/src/tools/rbd_ggate/main.cc b/src/tools/rbd_ggate/main.cc index 23096957bf1d..a2d6dbca7524 100644 --- a/src/tools/rbd_ggate/main.cc +++ b/src/tools/rbd_ggate/main.cc @@ -21,7 +21,7 @@ #include "common/Preforker.h" #include "common/TextTable.h" #include "common/ceph_argparse.h" -#include "common/config.h" +#include "common/config_proxy.h" #include "common/debug.h" #include "common/errno.h" #include "global/global_init.h" @@ -404,23 +404,8 @@ int main(int argc, const char *argv[]) { usage(); exit(0); } - - std::string conf_file_list; - std::string cluster; - CephInitParameters iparams = ceph_argparse_early_args( - args, CEPH_ENTITY_TYPE_CLIENT, &cluster, &conf_file_list); - - md_config_t config; - config.name = iparams.name; - config.cluster = cluster; - - if (!conf_file_list.empty()) { - config.parse_config_files(conf_file_list.c_str(), nullptr, 0); - } else { - config.parse_config_files(nullptr, nullptr, 0); - } - config.parse_env(); - config.parse_argv(args); + // filter out ceph config options + ConfigProxy{false}.parse_argv(args); std::string format; bool pretty_format = false;