Repository navigation
mgr/dashboard: NVMeoF CLI dont show empty table when no data for read commands - #69861
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves the NVMeoF CLI text output formatting in the Dashboard mgr module so that “list”/read commands don’t render an empty table when the underlying data list is empty, and instead show a meaningful “No …” message (matching the ceph CLI UX in the issue report).
Changes:
- Introduces a
CliEmptyMessageannotation forCliFlags.EXCLUSIVE_LISTfields to define a custom empty-list message (optionally templated). - Extends the NVMeoF CLI output formatter to return that message (with template substitution using response fields and CLI args) instead of an empty table.
- Adds unit tests covering empty-message formatting, templating, and ensuring JSON/YAML output behavior remains unchanged.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
src/pybind/mgr/dashboard/services/nvmeof_cli.py |
Adds templated empty-message support to the Annotated data formatter and passes CLI args as template context. |
src/pybind/mgr/dashboard/model/nvmeof.py |
Introduces CliEmptyMessage annotation and applies it to key NVMeoF list models (subsystems/connections/listeners/hosts). |
src/pybind/mgr/dashboard/tests/test_nvmeof_cli.py |
Adds new tests validating empty-message output and serialization behavior. |
4cf811f to
979f4d6
Compare
cecf91c to
eb35329
Compare
|
jenkins test windows |
|
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. |
example:
no data:
with data - behavior not changed:
Fixes: https://tracker.ceph.com/issues/77853
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.