]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tools/ceph-bluestore-tool: fix "--yes-i-really-really-mean-it" option
authorIgor Fedotov <igor.fedotov@croit.io>
Thu, 5 Sep 2024 19:01:01 +0000 (22:01 +0300)
committerAdam Kupczyk <akupczyk@ibm.com>
Wed, 25 Sep 2024 06:02:36 +0000 (06:02 +0000)
Fixes: https://tracker.ceph.com/issues/67926
Signed-off-by: Igor Fedotov <igor.fedotov@croit.io>
(cherry picked from commit c266ef0f61f7de29b56119171625dd61b8c0f0a2)
Conflicts:
  'trim' option was not present, but --yes-i-really-really-mean-it was
used

src/os/bluestore/bluestore_tool.cc

index b1cc5807dfd1a6ccf09391bad148f8537dd1306f..a478efc27784278af175d64be435127984e2c295 100644 (file)
@@ -307,6 +307,7 @@ int main(int argc, char **argv)
     ("key,k", po::value<string>(&key), "label metadata key name")
     ("value,v", po::value<string>(&value), "label metadata value")
     ("allocator", po::value<vector<string>>(&allocs_name), "allocator to inspect: 'block'/'bluefs-wal'/'bluefs-db'")
+    ("yes-i-really-really-mean-it", "additional confirmation for dangerous commands")
     ("sharding", po::value<string>(&new_sharding), "new sharding to apply")
     ("resharding-ctrl", po::value<string>(&resharding_ctrl), "gives control over resharding procedure details")
     ;
@@ -345,7 +346,11 @@ int main(int argc, char **argv)
   po::variables_map vm;
   try {
     po::parsed_options parsed =
-      po::command_line_parser(argc, argv).options(po_all).allow_unregistered().run();
+      po::command_line_parser(argc, argv).options(po_all)
+        .allow_unregistered()
+        .style(po::command_line_style::default_style &
+               ~po::command_line_style::allow_guessing)
+        .run();
     po::store( parsed, vm);
     po::notify(vm);
     ceph_option_strings = po::collect_unrecognized(parsed.options,