]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crush: parse CEPH_ARGS in crushtool
authorLoic Dachary <loic@dachary.org>
Sat, 11 Jan 2014 10:46:57 +0000 (11:46 +0100)
committerLoic Dachary <loic@dachary.org>
Sun, 12 Jan 2014 16:48:32 +0000 (17:48 +0100)
The arguments are not given to global_init because the -c option would
conflict. Reading arguments from CEPH_ARGS the way other ceph tools do
is the only way to control verbosity ( via --debug_crush 0 for instance ).

Signed-off-by: Loic Dachary <loic@dachary.org>
src/tools/crushtool.cc

index 55813c3d14f82c4fbd9683effb7c6285a70a1c48..dd394bfd1bc5da6f87f716c3ab4f209e9c6a04fd 100644 (file)
@@ -188,8 +188,11 @@ int main(int argc, const char **argv)
 
   CrushTester tester(crush, cerr);
 
-  vector<const char *> empty_args;  // we use -c, don't confuse the generic arg parsing
-  global_init(NULL, empty_args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY,
+  // we use -c, don't confuse the generic arg parsing
+  // only parse arguments from CEPH_ARGS, if in the environment
+  vector<const char *> env_args;
+  env_to_vec(env_args);
+  global_init(NULL, env_args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY,
              CINIT_FLAG_NO_DEFAULT_CONFIG_FILE);
   common_init_finish(g_ceph_context);