From d6c47ee0538ec4edd076c5bc46af7a12ace47a8c Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Wed, 10 Nov 2021 14:15:44 +0100 Subject: [PATCH] mgr/orch: Deprecate `ceph orch apply -i ` * Remove usage * Simplify error messages Fixes: https://tracker.ceph.com/issues/47401 Signed-off-by: Sebastian Wagner (cherry picked from commit 3fef006e0ea02f8d4b508f9d817624ee0129eadc) --- doc/cephadm/services/osd.rst | 6 +-- src/pybind/mgr/orchestrator/module.py | 53 ++++----------------------- 2 files changed, 10 insertions(+), 49 deletions(-) diff --git a/doc/cephadm/services/osd.rst b/doc/cephadm/services/osd.rst index 08cf7669bd3d2..b2193cefa9556 100644 --- a/doc/cephadm/services/osd.rst +++ b/doc/cephadm/services/osd.rst @@ -332,7 +332,7 @@ Alternatively, you can use your OSDSpec file: .. prompt:: bash # - ceph orch apply osd -i --dry-run + ceph orch apply -i --dry-run Expected output:: @@ -459,7 +459,7 @@ This means : .. prompt:: bash [monitor.1]# - ceph orch apply osd -i /path/to/osd_spec.yml + ceph orch apply -i /path/to/osd_spec.yml This instruction will be issued to all the matching hosts, and will deploy these OSDs. @@ -474,7 +474,7 @@ Example .. prompt:: bash [monitor.1]# - ceph orch apply osd -i /path/to/osd_spec.yml --dry-run + ceph orch apply -i /path/to/osd_spec.yml --dry-run diff --git a/src/pybind/mgr/orchestrator/module.py b/src/pybind/mgr/orchestrator/module.py index 19bc7b5bca9b6..7d03cdceba251 100644 --- a/src/pybind/mgr/orchestrator/module.py +++ b/src/pybind/mgr/orchestrator/module.py @@ -705,61 +705,22 @@ class OrchestratorCli(OrchestratorClientMixin, MgrModule, unmanaged: Optional[bool] = None, dry_run: bool = False, no_overwrite: bool = False, - inbuf: Optional[str] = None) -> HandleCommandResult: + inbuf: Optional[str] = None # deprecated. Was deprecated before Quincy + ) -> HandleCommandResult: """ - Create OSD daemon(s) using a drive group spec + Create OSD daemon(s) on all available devices """ - # Apply DriveGroupSpecs to create OSDs - usage = """ -usage: - ceph orch apply osd -i [--dry-run] - ceph orch apply osd --all-available-devices [--dry-run] [--unmanaged] - -Restrictions: - - Mutexes: - * -i, --all-available-devices - * -i, --unmanaged (this would overwrite the osdspec loaded from a file) - - Parameters: - - * --unmanaged - Only works with --all-available-devices. - -Description: - - * -i - An inbuf object like a file or a json/yaml blob containing a valid OSDSpec - - * --all-available-devices - The most simple OSDSpec there is. Takes all as 'available' marked devices - and creates standalone OSDs on them. - - * --unmanaged - Set a the unmanaged flag for all--available-devices (default is False) - -Examples: - - # ceph orch apply osd -i - - Applies one or more OSDSpecs found in - - # ceph orch osd apply --all-available-devices --unmanaged=true - - Creates and applies simple OSDSpec with the unmanaged flag set to -""" if inbuf and all_available_devices: - # mutually exclusive - return HandleCommandResult(-errno.EINVAL, stderr=usage) + return HandleCommandResult(-errno.EINVAL, '-i infile and --all-available-devices are mutually exclusive') if not inbuf and not all_available_devices: # one parameter must be present - return HandleCommandResult(-errno.EINVAL, stderr=usage) + return HandleCommandResult(-errno.EINVAL, '--all-available-devices is required') if inbuf: if unmanaged is not None: - return HandleCommandResult(-errno.EINVAL, stderr=usage) + return HandleCommandResult(-errno.EINVAL, stderr='-i infile and --unmanaged are mutually exclusive') try: drivegroups = [_dg for _dg in yaml.safe_load_all(inbuf)] @@ -791,7 +752,7 @@ Examples: ] return self._apply_misc(dg_specs, dry_run, format, no_overwrite) - return HandleCommandResult(-errno.EINVAL, stderr=usage) + return HandleCommandResult(-errno.EINVAL, stderr='--all-available-devices is required') @_cli_write_command('orch daemon add osd') def _daemon_add_osd(self, svc_arg: Optional[str] = None) -> HandleCommandResult: -- 2.39.5