]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commit
doc/_ext: fix ceph_commands.py for new decorator-based command system wip-moagrawa-seastore-io-uring-crimson-only
authorKefu Chai <k.chai@proxmox.com>
Sun, 8 Feb 2026 12:34:15 +0000 (20:34 +0800)
committerMohit Agrawal <moagrawa@redhat.com>
Mon, 9 Feb 2026 04:43:43 +0000 (10:13 +0530)
commit4a626c55ad065b6b32fd39c058f850e880973016
tree71fa9b9d06429eb5e72523cb32984e6bd634c42d
parentf81a0388d1e594a3aadb27d021984ebb00f7597e
doc/_ext: fix ceph_commands.py for new decorator-based command system

After commit 4aa9e246f, mgr modules migrated from using a class-level
COMMANDS list to decorator-based command registration using per-module
CLICommand instances (e.g., @BalancerCLICommand.Read('balancer status')).

This broke the ceph_commands.py Sphinx extension which was hardcoded to
expect m.COMMANDS to be a list, causing documentation builds to fail.

But not all modules are using this per-module CLICommand. Some modules are
fully migrated (balancer, hello, etc.) and use decorators, while others
are partially migrated (volumes, progress, stats, influx, k8sevents,
osd_perf_query, osd_support) - they have CLICommand defined but still
use the old COMMANDS list.

This fix updates _collect_module_commands() to handle three scenarios:

1. Fully migrated modules: Check CLICommand.dump_cmd_list() and use it
   if it returns commands
2. Partially migrated modules: Fall back to the old COMMANDS list if
   dump_cmd_list() returns empty
3. Legacy modules: Use COMMANDS list if CLICommand doesn't exist

This ensures the Sphinx extension works with modules in any migration
state, maintaining backwards compatibility while supporting the new
decorator pattern.

Signed-off-by: Kefu Chai <k.chai@proxmox.com>
doc/_ext/ceph_commands.py