ceph tool: incorrect pool delete line returns unintelligible failure message
gregf@kai:~/ceph/src [wip-6189-cache-promote]$ ./ceph osd pool delete base_pool *** DEVELOPER MODE: setting PATH, PYTHONPATH and LD_LIBRARY_PATH *** Invalid command: saw 0 of pool2(<poolname>), expected 1 Error EINVAL: invalid command
Going through ./ceph --help I managed to figure out the proper format is
gregf@kai:~/ceph/src [wip-6189-cache-promote]$ ./ceph osd pool delete base_pool base_pool --yes-i-really-really-mean-it *** DEVELOPER MODE: setting PATH, PYTHONPATH and LD_LIBRARY_PATH *** pool 'base_pool' deleted
but the error output certainly didn't help me get there.
ceph_argparse.py: clean up error reporting when required param missing
Treat "need 1, got 0" as a special case, and change the message to
"missing required parameter <x>". Also, when failing for that reason,
print the command concise description and its helptext.
#4 Updated by Greg Farnum almost 6 years ago
Yeah, that would probably be good. It's clearly gotten to the point that it knows what command it's looking at, but while as a developer I eventually figured out what was going on, "saw 0 of pool2(<poolname>), expected 1" is meaningless without the source.
#6 Updated by Dan Mick almost 6 years ago
With both those suggestions implemented, the output looks like this:
$ ./ceph osd pool delete data *** DEVELOPER MODE: setting PATH, PYTHONPATH and LD_LIBRARY_PATH *** Invalid command: missing required parameter pool2(<poolname>) osd pool delete <poolname> <poolname> --yes-i-really-really-mean-it: delete pool (say pool twice, add --yes-i-really-really-mean-it) Error EINVAL: invalid command
Does that seem like a reasonable result?