]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crush: display args on crushtool failure
authorLoic Dachary <loic@dachary.org>
Sat, 11 Jan 2014 10:19:51 +0000 (11:19 +0100)
committerLoic Dachary <loic@dachary.org>
Sun, 12 Jan 2014 16:48:32 +0000 (17:48 +0100)
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 <loic@dachary.org>
src/tools/crushtool.cc

index dd394bfd1bc5da6f87f716c3ab4f209e9c6a04fd..35a589ac1857b9bb483ddfaaa8b66778bc54cdd6 100644 (file)
@@ -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);