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'
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())