]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/orchestrator: accept --method arg to 'orch daemon add osd'
authorSage Weil <sage@newdream.net>
Tue, 3 Aug 2021 18:36:39 +0000 (14:36 -0400)
committerAdam King <adking@redhat.com>
Tue, 17 May 2022 14:25:59 +0000 (10:25 -0400)
Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit cef129d90abd73536a141fb375ce35cc7e5081a4)

Conflicts:
src/pybind/mgr/orchestrator/module.py

src/pybind/mgr/orchestrator/module.py

index b26be92fd2dd1ac0fe79211d7fba2ab3105255cd..f4646b3ddb811edd0fd134abb2cc177da7952a99 100644 (file)
@@ -9,7 +9,7 @@ import yaml
 from prettytable import PrettyTable
 
 from ceph.deployment.inventory import Device
-from ceph.deployment.drive_group import DriveGroupSpec, DeviceSelection
+from ceph.deployment.drive_group import DriveGroupSpec, DeviceSelection, OSDMethod
 from ceph.deployment.service_spec import PlacementSpec, ServiceSpec, service_spec_allow_invalid_from_json
 from ceph.deployment.hostspec import SpecValidationError
 from ceph.utils import datetime_now
@@ -777,7 +777,9 @@ class OrchestratorCli(OrchestratorClientMixin, MgrModule,
         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:
+    def _daemon_add_osd(self,
+                        svc_arg: Optional[str] = None,
+                        method: Optional[OSDMethod] = None) -> HandleCommandResult:
         """Create an OSD service. Either --svc_arg=host:drives"""
         # Create one or more OSDs"""
 
@@ -794,9 +796,10 @@ Usage:
             drive_group = DriveGroupSpec(
                 placement=PlacementSpec(host_pattern=host_name),
                 data_devices=devs,
+                method=method,
             )
         except (TypeError, KeyError, ValueError) as e:
-            msg = f"Invalid 'host:device' spec: '{svc_arg}': {e}" + usage
+            msg = f"Invalid host:device spec: '{svc_arg}': {e}" + usage
             return HandleCommandResult(-errno.EINVAL, stderr=msg)
 
         completion = self.create_osds(drive_group)