]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/orch: Deprecate `ceph orch apply -i <osd_spec_file>`
authorSebastian Wagner <sewagner@redhat.com>
Wed, 10 Nov 2021 13:15:44 +0000 (14:15 +0100)
committerSebastian Wagner <sewagner@redhat.com>
Mon, 3 Jan 2022 13:14:00 +0000 (14:14 +0100)
* Remove usage
* Simplify error messages

Fixes: https://tracker.ceph.com/issues/47401
Signed-off-by: Sebastian Wagner <sewagner@redhat.com>
(cherry picked from commit 3fef006e0ea02f8d4b508f9d817624ee0129eadc)

doc/cephadm/services/osd.rst
src/pybind/mgr/orchestrator/module.py

index 08cf7669bd3d2138762985ea8985920adfdde941..b2193cefa955607220cde1856855740c59afff7b 100644 (file)
@@ -332,7 +332,7 @@ Alternatively, you can use your OSDSpec file:
 
 .. prompt:: bash #
 
-  ceph orch apply osd -i <osd_spec_file> --dry-run
+  ceph orch apply -i <osd_spec_file> --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
 
 
 
index 19bc7b5bca9b61cc83cc5532735edc2be7ded80b..7d03cdceba251b2f8f965e4c573e52279d0715e4 100644 (file)
@@ -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 <json_file/yaml_file> [--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 <file.yml|json>
-
-   Applies one or more OSDSpecs found in <file>
-
-   # ceph orch osd apply --all-available-devices --unmanaged=true
-
-   Creates and applies simple OSDSpec with the unmanaged flag set to <true>
-"""
 
         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: