From: Loic Dachary Date: Sat, 11 Jan 2014 10:46:57 +0000 (+0100) Subject: crush: parse CEPH_ARGS in crushtool X-Git-Tag: v0.77~26^2~11 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2765f81affb46fc47a396d3fd486010e9c1e4d65;p=ceph.git crush: parse CEPH_ARGS in crushtool 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 --- diff --git a/src/tools/crushtool.cc b/src/tools/crushtool.cc index 55813c3d14f..dd394bfd1bc 100644 --- a/src/tools/crushtool.cc +++ b/src/tools/crushtool.cc @@ -188,8 +188,11 @@ int main(int argc, const char **argv) CrushTester tester(crush, cerr); - vector 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 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);