]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-ggate: filter out ceph options from args 23020/head
authorKefu Chai <kchai@redhat.com>
Fri, 13 Jul 2018 09:25:41 +0000 (17:25 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 13 Jul 2018 13:06:32 +0000 (21:06 +0800)
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 <mgolub@suse.com>
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/tools/rbd_ggate/main.cc

index 23096957bf1d1227fabf67c85ef8aed4a7d748bc..a2d6dbca7524ab5294844572d722b9d24ced0c41 100644 (file)
@@ -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;