From: Kefu Chai Date: Tue, 3 Mar 2026 04:51:32 +0000 (+0800) Subject: mgr/orchestrator: make group parameter optional for nvmeof (squid) X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5cef25d860f3a959ad8122676f09d235f62b6a8e;p=ceph.git mgr/orchestrator: make group parameter optional for nvmeof (squid) Add default value for group parameter in nvmeof commands to maintain backward compatibility with existing squid tests and deployments. Context: -------- On main branch, when commit 6bee4e10f7f added the group parameter, the tests were subsequently updated to provide the group argument explicitly: Main test: ceph orch apply nvmeof foo default Expected: nvmeof.foo.default However, on squid branch, the existing tests still use the older syntax without specifying a group: Squid test: ceph orch apply nvmeof foo Expected: nvmeof.foo The previous cherry-pick (e1612d048a1) fixed the service_id construction logic to handle empty groups correctly, but the group parameter was still required without a default value, causing "ceph orch apply nvmeof foo" to fail with EINVAL (missing required argument). This commit adds the missing default value (group: str = '') to make the parameter optional, maintaining backward compatibility with existing squid tests and user scripts that don't specify a group. With both changes: 1. Cherry-picked e1612d048a1: service_id logic handles empty group 2. This commit: group parameter has default value '' Result: "ceph orch apply nvmeof foo" works (creates nvmeof.foo) "ceph orch apply nvmeof foo mygroup" also works (creates nvmeof.foo.mygroup) Test: qa/suites/orch/cephadm/smoke-roleless/2-services/nvmeof.yaml Fixes job 50373 failure from test run dgalloway-2026-02-13_23:06:25 Please note, this change was not cherry-picked from main branch, because main intentionally still requires the CLI group argument for arch apply/add nvmeof, and its tests were updated accordingly. On squid, however, the earlier cherry-pick 6bee4e10 introduced the required group parameter, but squid still has the old test/behavior (ceph orch apply nvmeof foo expecting nvmeof.foo) and does not contain the later main commits 3e5e85aadc1 and b377085c302. Signed-off-by: Kefu Chai --- diff --git a/src/pybind/mgr/orchestrator/module.py b/src/pybind/mgr/orchestrator/module.py index c38b57ae5239..df1fe1bf7208 100644 --- a/src/pybind/mgr/orchestrator/module.py +++ b/src/pybind/mgr/orchestrator/module.py @@ -1566,7 +1566,7 @@ Usage: @_cli_write_command('orch daemon add nvmeof') def _nvmeof_add(self, pool: str, - group: str, + group: str = '', placement: Optional[str] = None, inbuf: Optional[str] = None) -> HandleCommandResult: """Start nvmeof daemon(s)""" @@ -1880,7 +1880,7 @@ Usage: @_cli_write_command('orch apply nvmeof') def _apply_nvmeof(self, pool: str, - group: str, + group: str = '', placement: Optional[str] = None, unmanaged: bool = False, dry_run: bool = False,