From 2765f81affb46fc47a396d3fd486010e9c1e4d65 Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Sat, 11 Jan 2014 11:46:57 +0100 Subject: [PATCH] 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 --- src/tools/crushtool.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/tools/crushtool.cc b/src/tools/crushtool.cc index 55813c3d14f82..dd394bfd1bc5d 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); -- 2.39.5