]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crushtool: rename "--check-names" to "--check"
authorKefu Chai <kchai@redhat.com>
Tue, 26 May 2015 09:51:50 +0000 (17:51 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 10 Jul 2015 07:40:02 +0000 (15:40 +0800)
* because "--check" also checks for the max_id

Note: edited since we do not have the fix introduced in 46103b2 in
      hammer.

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 9381d53acdce85fcbff828926b911e050ba36e51)

src/test/cli/crushtool/check-names.max-id.t
src/test/cli/crushtool/help.t
src/tools/crushtool.cc

index 0fa5c0127369d1ffc3cdb6c80334f5d5fb2da6d1..dab2d316f94f7ccf8e82768210e2772480105c47 100644 (file)
@@ -1,7 +1,7 @@
   $ crushtool -i "$TESTDIR/simple.template" --add-item 0 1.0 device0 --loc host host0 --loc cluster cluster0 -o check-names.crushmap > /dev/null
   $ crushtool -i check-names.crushmap       --add-item 1 1.0 device1 --loc host host0 --loc cluster cluster0 -o check-names.crushmap > /dev/null
-  $ crushtool -i check-names.crushmap --check-names=2
+  $ crushtool -i check-names.crushmap --check 2
   $ crushtool -i check-names.crushmap       --add-item 2 1.0 device2 --loc host host0 --loc cluster cluster0 -o check-names.crushmap > /dev/null
-  $ crushtool -i check-names.crushmap --check-names=2
+  $ crushtool -i check-names.crushmap --check 2
   item id too large: item#2
   [1]
index ab54bd5a5122ba60d238afde04b4d701d263d7cb..9c81b7c77f792043bb405f2f2f5f368d79f29cab 100644 (file)
@@ -33,8 +33,7 @@
   
   Options for the display/test stage
   
-     --check-names max_id
-                           check if any item is referencing an unknown name/type
+     --check max_id        check if any item is referencing an unknown name/type
      -i mapfn --show-location id
                            show location for given device id
      --show-utilization    show OSD usage
index 4881b0ae3c04e6bbce0dc0a0afa35e2c6c4b0ad8..3e36ac9870401c6aaa79b03df4e7ce79b5e081d5 100644 (file)
@@ -138,8 +138,7 @@ void usage()
   cout << "\n";
   cout << "Options for the display/test stage\n";
   cout << "\n";
-  cout << "   --check-names max_id\n";
-  cout << "                         check if any item is referencing an unknown name/type\n";
+  cout << "   --check max_id        check if any item is referencing an unknown name/type\n";
   cout << "   -i mapfn --show-location id\n";
   cout << "                         show location for given device id\n";
   cout << "   --show-utilization    show OSD usage\n";
@@ -196,7 +195,7 @@ int main(int argc, const char **argv)
   std::string infn, srcfn, outfn, add_name, remove_name, reweight_name;
   bool compile = false;
   bool decompile = false;
-  bool check_names = false;
+  bool check = false;
   int max_id = -1;
   bool test = false;
   bool display = false;
@@ -283,8 +282,8 @@ int main(int argc, const char **argv)
     } else if (ceph_argparse_witharg(args, i, &val, "-c", "--compile", (char*)NULL)) {
       srcfn = val;
       compile = true;
-    } else if (ceph_argparse_withint(args, i, &max_id, &err, "--check-names", (char*)NULL)) {
-      check_names = true;
+    } else if (ceph_argparse_withint(args, i, &max_id, &err, "--check", (char*)NULL)) {
+      check = true;
     } else if (ceph_argparse_flag(args, i, "-t", "--test", (char*)NULL)) {
       test = true;
     } else if (ceph_argparse_withint(args, i, &full_location, &err, "--show-location", (char*)NULL)) {
@@ -471,7 +470,7 @@ int main(int argc, const char **argv)
     }
   }
 
-  if (test && !check_name && !display && !write_to_file) {
+  if (test && !check && !display && !write_to_file) {
     cerr << "WARNING: no output selected; use --output-csv or --show-X" << std::endl;
   }
 
@@ -479,7 +478,7 @@ int main(int argc, const char **argv)
     cerr << "cannot specify more than one of compile, decompile, and build" << std::endl;
     exit(EXIT_FAILURE);
   }
-  if (!check_names && !compile && !decompile && !build && !test && !reweight && !adjust && !tree &&
+  if (!check && !compile && !decompile && !build && !test && !reweight && !adjust && !tree &&
       add_item < 0 && full_location < 0 &&
       remove_name.empty() && reweight_name.empty()) {
     cerr << "no action specified; -h for help" << std::endl;
@@ -813,7 +812,7 @@ int main(int argc, const char **argv)
     }
   }
 
-  if (check_names) {
+  if (check) {
     if (!tester.check_name_maps(max_id)) {
       exit(1);
     }