cmd = CFSD_PREFIX.format(osd=ONEOSD)
ERRORS += test_failure(cmd, "Must provide --op or object command...")
+ # Specify a bad --op command
+ cmd = (CFSD_PREFIX + "--op oops").format(osd=ONEOSD)
+ ERRORS += test_failure(cmd, "Must provide --op (info, log, remove, export, import, list, fix-lost, list-pgs, rm-past-intervals, set-allow-sharded-objects, dump-journal, dump-super, meta-list)")
+
TMPFILE = r"/tmp/tmp.{pid}".format(pid=pid)
ALLPGS = OBJREPPGS + OBJECPGS
OSDS = get_osds(ALLPGS[0], OSDDIR)
goto out;
}
+ // If not an object command nor any of the ops handled below, then output this usage
+ // before complaining about a bad pgid
+ if (!vm.count("objcmd") && op != "export" && op != "info" && op != "log" && op != "rm-past-intervals") {
+ cerr << "Must provide --op (info, log, remove, export, import, list, fix-lost, list-pgs, rm-past-intervals, set-allow-sharded-objects, dump-journal, dump-super, meta-list)"
+ << std::endl;
+ usage(desc);
+ ret = 1;
+ goto out;
+ }
epoch_t map_epoch;
// The following code for export, info, log require omap or !skip-mount-omap
if (it != ls.end()) {
cout << "Removal succeeded" << std::endl;
}
} else {
- cerr << "Must provide --op (info, log, remove, export, import, list, fix-lost, list-pgs, rm-past-intervals, set-allow-sharded-objects, dump-journal, dump-super, meta-list)"
- << std::endl;
- usage(desc);
- ret = 1;
+ assert(!"Should have already checked for valid --op");
}
} else {
cerr << "PG '" << pgid << "' not found" << std::endl;