Bug #6384
closed
ceph tool: incorrect pool delete line returns unintelligible failure message
Added by Greg Farnum over 10 years ago.
Updated over 10 years ago.
Description
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.
- Assignee set to Dan Mick
- Priority changed from Normal to High
Not sure what you'd want to happen here; the "semantic reason for the failure of the command" is a bit of a stretch. We could maybe print the help for the failing command if there's only one that could have matched?....
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.
Yeah, it's not the best message. Maybe we should special case the 'saw 0 expected 1' case to something more intelligible, like "must supply <pool2>" (since it's by far the
most common case)
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?
well, I've created a pull request; if you want to review, now's your chance
- Status changed from New to Fix Under Review
- Status changed from Fix Under Review to Resolved
Also available in: Atom
PDF