From cfe7d47d38fd103601c09eceb98b9c7365869fba Mon Sep 17 00:00:00 2001 From: David Zafman Date: Mon, 22 Jun 2015 19:16:22 -0700 Subject: [PATCH] tools: Check and specify commands that require the pgid specification Signed-off-by: David Zafman (cherry picked from commit 5534bc864813d96a0d20791d79151c4f6695a013) --- src/tools/ceph_objectstore_tool.cc | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/tools/ceph_objectstore_tool.cc b/src/tools/ceph_objectstore_tool.cc index 28843c46f6fdb..9dcc81e2b86c6 100644 --- a/src/tools/ceph_objectstore_tool.cc +++ b/src/tools/ceph_objectstore_tool.cc @@ -2655,7 +2655,7 @@ int main(int argc, char **argv) ("journal-path", po::value(&jpath), "path to journal, mandatory for filestore type") ("pgid", po::value(&pgidstr), - "PG id, mandatory except for import, fix-lost, list-pgs, set-allow-sharded-objects, dump-journal, dump-super") + "PG id, mandatory for info, log, remove, export, rm-past-intervals") ("op", po::value(&op), "Arg is one of [info, log, remove, export, import, list, fix-lost, list-pgs, rm-past-intervals, set-allow-sharded-objects, dump-journal, dump-super]") ("file", po::value(&file), @@ -3055,14 +3055,10 @@ int main(int argc, char **argv) } } - // The ops which don't require --pgid option are checked here and - // mentioned in the usage for --pgid with some exceptions. - // The dump-journal op isn't here because it is handled earlier. - // The dump-journal-mount op is undocumented so not in the usage. - if (op != "list" && op != "import" && op != "fix-lost" - && op != "list-pgs" && op != "set-allow-sharded-objects" - && op != "dump-journal-mount" && op != "dump-super" - && (pgidstr.length() == 0)) { + // The ops which require --pgid option are checked here and + // mentioned in the usage for --pgid. + if ((op == "info" || op == "log" || op == "remove" || op == "export" + || op == "rm-past-intervals") && pgidstr.length() == 0) { cerr << "Must provide pgid" << std::endl; usage(desc); ret = 1; -- 2.39.5