From 5b95d183c811bd759e52618decee16caba96105a Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Sat, 11 Jan 2014 11:19:51 +0100 Subject: [PATCH] crush: display args on crushtool failure When the number of args provided to --build is not a multiple of 3, display the arguments which do not comply. For instance the --debug_crush 0 option is not consumed by global_init in crushtool because, unlike most ceph tools, the arguments are not passed to global_init. As a result --debug_crush 0 become part of the arguments and triggers the failure. crushtool --debug_crush 0 --build --num_osds 320 node straw 4 remaining args: [--debug_crush,0,node,straw,4] layers must be specified with 3-tuples of (name, buckettype, size) Signed-off-by: Loic Dachary --- src/tools/crushtool.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tools/crushtool.cc b/src/tools/crushtool.cc index dd394bfd1bc5d..35a589ac1857b 100644 --- a/src/tools/crushtool.cc +++ b/src/tools/crushtool.cc @@ -432,6 +432,7 @@ int main(int argc, const char **argv) } else { if ((args.size() % 3) != 0U) { + cerr << "remaining args: " << args << std::endl; cerr << "layers must be specified with 3-tuples of (name, buckettype, size)" << std::endl; exit(EXIT_FAILURE); -- 2.39.5