Skip to content

mgr/dashboard: NVMeoF CLI dont show empty table when no data for read commands - #69861

Merged
Hezko merged 1 commit into
ceph:mainfrom
Hezko:msg-whem-empty
Jul 12, 2026
Merged

Hezko merged 1 commit into
ceph:mainfrom
Hezko:msg-whem-empty

Conversation

@Hezko

@Hezko Hezko commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

example:
no data:

[xxx@xxx ~]# ceph nvmeof subsystem list
No subsystems
[xxx@xxx ~]# ceph nvmeof listener list --nqn=nqn.2016-06.io.spdk:cnode5.mygroup1
No listeners for nqn.2016-06.io.spdk:cnode5.mygroup1
[xxx@xxx ~]# ceph nvmeof host list --nqn=nqn.2016-06.io.spdk:cnode5.mygroup1
No hosts are allowed to access nqn.2016-06.io.spdk:cnode5.mygroup1
[xxx@xxx ~]# ceph nvmeof connection list --nqn=nqn.2016-06.io.spdk:cnode5.mygroup1
No connections for nqn.2016-06.io.spdk:cnode5.mygroup1

with data - behavior not changed:

[xxx@xxx ~]# ceph nvmeof connection list --nqn=nqn.2016-06.io.spdk:cnode1.mygroup1
+--------------------------------------------------------------------+------+-------+------+------+---------+------------+-------------+-------+----------+------------------------+-----------------------------------+-------------------------------------+
|Nqn                                                                 |Traddr|Trsvcid|Trtype|Adrfam|Connected|Qpairs Count|Controller Id|Use Psk|Use Dhchap|Dhchap Controller Origin|Subsystem                          |Disconnected Due To Keepalive Timeout|
+--------------------------------------------------------------------+------+-------+------+------+---------+------------+-------------+-------+----------+------------------------+-----------------------------------+-------------------------------------+
|nqn.2014-08.org.nvmexpress:uuid:6def1fb3-a3a2-447b-9938-59856fc4805f|<n/a> |0      |      |ipv4  |False    |-1          |-1           |False  |True      |Subsystem Implicit      |nqn.2016-06.io.spdk:cnode1.mygroup1|False                                |
+--------------------------------------------------------------------+------+-------+------+------+---------+------------+-------------+-------+----------+------------------------+-----------------------------------+-------------------------------------+
[root@empty-tomer-cluster-node1 ~]# ceph nvmeof host list --nqn=nqn.2016-06.io.spdk:cnode1.mygroup1
+--------------------------------------------------------------------+-------+----------+------------------------+
|Nqn                                                                 |Use Psk|Use Dhchap|Dhchap Controller Origin|
+--------------------------------------------------------------------+-------+----------+------------------------+
|nqn.2014-08.org.nvmexpress:uuid:6def1fb3-a3a2-447b-9938-59856fc4805f|False  |True      |Subsystem Implicit      |
+--------------------------------------------------------------------+-------+----------+------------------------+
[root@empty-tomer-cluster-node1 ~]# ceph nvmeof listener list --nqn=nqn.2016-06.io.spdk:cnode1.mygroup1
+-------------------------+---------+--------------+------------+----+------+------+------+
|Host                     |Transport|Address Family|Address     |Port|Secure|Active|Manual|
+-------------------------+---------+--------------+------------+----+------+------+------+
|empty-tomer-cluster-node1|TCP      |ipv4          |10.243.64.41|4420|False |True  |True  |
|empty-tomer-cluster-node2|TCP      |ipv4          |10.243.64.39|4420|False |False |True  |
+-------------------------+---------+--------------+------------+----+------+------+------+

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 x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 CliEmptyMessage annotation for CliFlags.EXCLUSIVE_LIST fields 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.

@Hezko
Hezko force-pushed the msg-whem-empty branch from a8a1f8a to 5346249 Compare July 1, 2026 08:12
@Hezko Hezko changed the title mgr/dashboard: dont show empty table when no data for read commands mgr/dashboard: NVMeoF CLI dont show empty table when no data for read commands Jul 1, 2026
@Hezko
Hezko force-pushed the msg-whem-empty branch 3 times, most recently from 4cf811f to 979f4d6 Compare July 7, 2026 08:00
@github-project-automation github-project-automation Bot moved this from New to Reviewer approved in Ceph-Dashboard Jul 7, 2026

@pujaoshahu pujaoshahu left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Hezko
Hezko force-pushed the msg-whem-empty branch 2 times, most recently from cecf91c to eb35329 Compare July 8, 2026 09:59
@Hezko

Hezko commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

jenkins test windows

@Hezko
Hezko force-pushed the msg-whem-empty branch from eb35329 to 586a4e3 Compare July 9, 2026 07:24
@Hezko
Hezko merged commit 2b2be0b into ceph:main Jul 12, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from Reviewer approved to Done in Ceph-Dashboard Jul 12, 2026
@Hezko
Hezko deleted the msg-whem-empty branch July 12, 2026 23:37
@github-actions

Copy link
Copy Markdown

This is an automated message by src/script/redmine-upkeep.py.

I found one or more Fixes: tags in the commit messages in

git log 2b2be0b72c0fb6a4d573b58d0ac2f76d03b809b0^..2b2be0b72c0fb6a4d573b58d0ac2f76d03b809b0

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.

Update Log: https://github.com/ceph/ceph/actions/runs/29213717311

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants