]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Handle whitespace in upgrade daemon types
authorUjjawal Anand <ujjawal.anand@ibm.com>
Thu, 20 Nov 2025 11:17:14 +0000 (16:47 +0530)
committerUjjawal Anand <ujjawal.anand@ibm.com>
Wed, 25 Feb 2026 08:42:31 +0000 (14:12 +0530)
Resolves: https://tracker.ceph.com/issues/75153

Signed-off-by: Ujjawal Anand <ujjawal.anand@ibm.com>
src/pybind/mgr/cephadm/module.py
src/pybind/mgr/orchestrator/module.py

index aec32f1fb7b0c664354bcfde985ff249225c7a43..89c4696ee1f2c1d019ecb5f7dbb8368309e203f5 100644 (file)
@@ -4087,6 +4087,9 @@ Then run the following:
         if daemon_types is not None and services is not None:
             raise OrchestratorError('--daemon-types and --services are mutually exclusive')
         if daemon_types is not None:
+            # Strip any whitespace around daemon types provided via the CLI so that
+            # `--daemon_types "mon, crash"` is treated the same as `--daemon_types "mon,crash"`.
+            daemon_types = [dtype.strip() for dtype in daemon_types]
             for dtype in daemon_types:
                 if dtype not in utils.CEPH_IMAGE_TYPES:
                     raise OrchestratorError(f'Upgrade aborted - Got unexpected daemon type "{dtype}".\n'
index b570e8ced27f412c6053fa75e24e71a4927ded11..8257ce91f339cd96d690939a012423742deafe2c 100644 (file)
@@ -2570,8 +2570,9 @@ Usage:
                        ceph_version: Optional[str] = None) -> HandleCommandResult:
         """Initiate upgrade"""
         self._upgrade_check_image_name(image, ceph_version)
-        dtypes = daemon_types.split(',') if daemon_types is not None else None
-        service_names = services.split(',') if services is not None else None
+        # Split comma-separated lists and trim whitespace so "mon, crash" and "mon,crash" are equivalent.
+        dtypes = [d.strip() for d in daemon_types.split(',')] if daemon_types is not None else None
+        service_names = [s.strip() for s in services.split(',')] if services is not None else None
         completion = self.upgrade_start(image, ceph_version, dtypes, hosts, service_names, limit)
         raise_if_exception(completion)
         return HandleCommandResult(stdout=completion.result_str())