Repository navigation
mgr/dashboard: add deprecation warning on ns add cli command - #70209
Conversation
|
jenkins test make check |
08fc092 to
2ff2f71
Compare
| out_format = cmd_dict.get('format') | ||
| args_map = self._args_map_from_argspec(cmd_dict, inbuf) |
There was a problem hiding this comment.
Bug: _args_map_from_argspec was inside the try block before — it can throw on malformed args. Moving it out means those exceptions are now uncaught and will crash instead of returning HandleCommandResult(-EINVAL, '', str(e)).
Keep both lines inside try, init deprecated_warnings = '' before try, then compute warnings inside try right after args_map:
deprecated_warnings = ''
try:
out_format = cmd_dict.get('format')
args_map = self._args_map_from_argspec(cmd_dict, inbuf)
if out_format == 'plain' or not out_format:
for param, msg in self._deprecated_params.items():
if args_map.get(param) is not None:
deprecated_warnings += f"\nWarning: {msg}"
ret = super().call(mgr, cmd_dict, inbuf)There was a problem hiding this comment.
great catch! fixed and added a test for this case.
Thank you!
2ff2f71 to
3723e76
Compare
There was a problem hiding this comment.
Pull request overview
Adds deprecation warnings when --size is used with NVMe-oF namespace creation commands.
Changes:
- Adds reusable deprecated-parameter warning support.
- Configures
--sizedeprecation for namespace creation and its alias. - Adds unit tests for warning behavior and output formats.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/pybind/mgr/dashboard/services/nvmeof_cli.py |
Implements deprecated-parameter warnings. |
src/pybind/mgr/dashboard/controllers/nvmeof.py |
Marks namespace size as deprecated. |
src/pybind/mgr/dashboard/tests/test_nvmeof_cli.py |
Tests warning generation and error handling. |
3723e76 to
6ac6f8b
Compare
6ac6f8b to
68ee29f
Compare
68ee29f to
7368a64
Compare
7368a64 to
c47b6f4
Compare
|
jenkins test docs |
|
This is an automated message by src/script/redmine-upkeep.py. I found one or more
The referenced tickets are: Those tickets do not reference this merged Pull Request. If this Pull Request merge resolves any of those tickets, please update the "Pull Request ID" field on each ticket. A future run of this script will appropriately update them. |
The user will now have an indication when using a deprecated parameter.
Fixes: https://tracker.ceph.com/issues/78228
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.