Repository navigation
pybind: Fix CLI error message when using force parameter if it doesn't exist - #70246
Conversation
…ist in a command's arguments schema Fixes: https://tracker.ceph.com/issues/78291 Signed-off-by: Tomer Haskalovitch <[email protected]>
1189ea8 to
e8be5e2
Compare
| or myarg == "--yes-i-really-really-mean-it" \ | ||
| or myarg == "--yes-i-really-really-mean-it-not-faking" \ | ||
| or myarg == "--force" \ | ||
| or (myarg == "--force" and 'force' in arg_descs_by_name) \ |
There was a problem hiding this comment.
we could have dropped this special case. but unfortunately, the nvmeof mgr module declares force: Optional[str] = "false" under @NvmeofCLICommand, so we still need to keep it if we want to be backward compatible.
one gap though, there are three --yes-i-really-* flags above this line might need the same treatment. but the fix addresses the referenced issue. we could address the nvme (this could be risky) and --yes-i-really-* in follow-up changes.
|
This is an automated message by src/script/redmine-upkeep.py. I have resolved the following tracker ticket due to the merge of this PR: No backports are pending for the ticket. If this is incorrect, please update the tracker |
Running a command that has no force parameter with --force produces a cryptic error instead of a clean rejection:
ceph_argparse.py hardcodes
--forceas an exception in the positional-argument validation loop (line 1244), originally added for backward compatibility with pre-Nautilus daemons that defined force as aCephStringpositional parameter instead ofCephBool. The exception fired unconditionally — even when force was not part of the command's schema at all — allowing--forceto be silently absorbed as the value of the next positional parameter (e.g.nsid). The module then tried int('--force') and crashed.This PR fixes it:
Fixes: https://tracker.ceph.com/issues/78291
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.